Compare commits

...
14 Commits
+178 -40
View File
@@ -59,21 +59,26 @@ FLATPAK_PACKAGES=(
"com.collaboraoffice.Office" "com.collaboraoffice.Office"
"io.github.kolunmi.Bazaar" "io.github.kolunmi.Bazaar"
"com.fastmail.Fastmail" "com.fastmail.Fastmail"
"org.waywallen.waywallen"
) )
GNOME_EXTENSIONS=( GNOME_EXTENSIONS=(
"dhruva@narkagni" "dash-to-dock@micxgx.gmail.com"
"app-grid-wizard@mirzadeh.pro" "dynamic-music-pill@andbal"
"gamemodeshellextension@trsnaqe.com"
"gnome-fuzzy-app-search@gnome-shell-extensions.Czarlie.gitlab.com"
"IP-Finder@linxgem33.com"
"lan-ip-address@mrhuber.com"
"add-to-steam@pupper.space"
"appindicatorsupport@rgcjonas.gmail.com" "appindicatorsupport@rgcjonas.gmail.com"
"blur-my-shell@aunetx" "blur-my-shell@aunetx"
"caffeine@patapon.info" "caffeine@patapon.info"
"dynamic-music-pill@andbal" "compiz-alike-magic-lamp-effect@hermes83.github.com"
"gnome-fuzzy-app-search@gnome-shell-extensions.Czarlie.gitlab.com" "gsconnect@andyholmes.github.io"
#"IP-Finder@linxgem33.com" "hotedge@jonathan.jdoda.ca"
#"lan-ip-address@mrhuber.com" "logomenu@aryan_k"
#"update-extension@purejava.org" "restartto@tiagoporsch.github.io"
"user-theme@gnome-shell-extensions.gcampax.github.com" "user-theme@gnome-shell-extensions.gcampax.github.com"
"gnome-wallpaper-engine@gjs.com.zip"
) )
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@@ -159,24 +164,16 @@ optimize_dnf() {
install_fonts() { install_fonts() {
log_info "----------------------------------------------------" log_info "----------------------------------------------------"
log_info "Installing Microsoft Core Fonts and Meslo Nerd Font." log_info "Installing Meslo Nerd Font."
log_info "----------------------------------------------------" log_info "----------------------------------------------------"
log_info "Updating system and installing prerequisites..." log_info "Updating system and installing prerequisites..."
sudo dnf upgrade --refresh -y sudo dnf upgrade --refresh -y
check_status "System upgrade" "critical" check_status "System upgrade" "critical"
sudo dnf install -y curl cabextract xorg-x11-font-utils fontconfig wget unzip sudo dnf install -y curl fontconfig wget unzip
check_status "Prerequisites installation" "critical" check_status "Prerequisites installation" "critical"
log_info "Installing Microsoft Core Fonts..."
if rpm -q msttcore-fonts-installer > /dev/null 2>&1; then
log_warn "Microsoft Core Fonts already installed."
else
sudo dnf install -y https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
check_status "Microsoft Core Fonts installation" "non-critical"
fi
log_info "Installing Meslo Nerd Font..." log_info "Installing Meslo Nerd Font..."
FONT_NAME="MesloLGS Nerd Font Mono" FONT_NAME="MesloLGS Nerd Font Mono"
# Redirect instead of `grep -q` so fc-list isn't killed by SIGPIPE (pipefail) # Redirect instead of `grep -q` so fc-list isn't killed by SIGPIPE (pipefail)
@@ -224,8 +221,9 @@ install_software() {
sudo dnf install -y flatpak sudo dnf install -y flatpak
fi fi
log_info "Adding Flathub remote..." log_info "Adding Flathub remote and setting its priority..."
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo flatpak remote-modify --prio=10 flathub || true
check_status "Flathub remote add" "non-critical" check_status "Flathub remote add" "non-critical"
log_info "Installing Flatpak packages..." log_info "Installing Flatpak packages..."
@@ -519,24 +517,32 @@ install_gnome_extensions() {
# Define the tool path explicitly to avoid 'pipx run' overhead/warnings # Define the tool path explicitly to avoid 'pipx run' overhead/warnings
EXTENSION_TOOL="$HOME/.local/bin/gnome-extensions-cli" EXTENSION_TOOL="$HOME/.local/bin/gnome-extensions-cli"
log_info "Installing GNOME extensions..." log_info "Installing GNOME extensions without user prompts (--filesystem backend)..."
log_info "NOTE: A popup may appear asking you to confirm installation for each extension."
log_info "If the extension is already installed, no popup will appear."
for extension in "${GNOME_EXTENSIONS[@]}"; do for extension in "${GNOME_EXTENSIONS[@]}"; do
log_info "Processing $extension..." log_info "Processing $extension..."
# Install (using the direct binary path) # Install using the filesystem backend to bypass the GUI confirmation popups
"$EXTENSION_TOOL" install "$extension" "$EXTENSION_TOOL" --filesystem install "$extension"
check_status "GNOME Extension $extension" "non-critical" check_status "GNOME Extension $extension" "non-critical"
# Attempt to enable the extension (in case it's installed but disabled) # Attempt to enable the extension (in case it's installed but disabled)
log_info "Ensuring $extension is enabled..." log_info "Ensuring $extension is enabled..."
gnome-extensions enable "$extension" gnome-extensions enable "$extension" || true
# Prompt user to press Enter to continue
read -p "Press Enter to continue (if a popup appeared, confirm it first)..."
done done
log_info "Installing waywallen-display extension from GitHub..."
WAYWALLEN_URL=$(curl -s https://api.github.com/repos/waywallen/waywallen-display/releases/latest | grep -oP 'https://[^"]+waywallen-gnome-[^"]+-x86_64\.zip' | head -n 1)
if [ -n "$WAYWALLEN_URL" ]; then
TEMP_EXT=$(mktemp -d)
curl -sL "$WAYWALLEN_URL" -o "$TEMP_EXT/waywallen.zip"
gnome-extensions install -f "$TEMP_EXT/waywallen.zip"
gnome-extensions enable org.waywallen.gnome@waywallen.io || true
rm -rf "$TEMP_EXT"
check_status "Waywallen GNOME Extension" "non-critical"
else
log_error "Failed to resolve Waywallen extension download URL."
fi
} }
install_antigravity() { install_antigravity() {
@@ -549,13 +555,97 @@ install_antigravity() {
check_status "Antigravity CLI installation" "non-critical" check_status "Antigravity CLI installation" "non-critical"
log_info "Installing Antigravity App and IDE..." log_info "Installing Antigravity App and IDE..."
# Community installer (opensnap). It downloads Google's official tarballs sudo dnf install -y python3 nautilus-python curl tar
# into /opt and adds launchers. It needs python3, and nautilus-python
# enables its "Open in Antigravity IDE" entry in Files. log_info "Fetching latest download URLs from Google..."
sudo dnf install -y python3 nautilus-python AG_URL=$(curl -fsSL --compressed https://antigravity.google/download | grep -oP 'https://\S+linux-x64/Antigravity\.tar\.gz' | head -n 1)
INSTALLER_URL="https://opensnap.github.io/antigravity/install.sh" AG_IDE_URL=$(curl -fsSL --compressed https://antigravity.google/download | grep -oP 'https://\S+linux-x64/Antigravity%20IDE\.tar\.gz' | head -n 1)
curl -fsSL "$INSTALLER_URL" | sudo -E env ANTIGRAVITY_LINUX_INSTALLER_URL="$INSTALLER_URL" bash -s -- --all
check_status "Antigravity App and IDE installation" "non-critical" if [ -z "$AG_URL" ] || [ -z "$AG_IDE_URL" ]; then
log_error "Failed to resolve Antigravity download URLs."
FAILED_STEPS+=("Antigravity installation")
return
fi
log_info "Installing Antigravity 2.0 App..."
sudo rm -rf /opt/antigravity
sudo mkdir -p /opt/antigravity
if ! curl -sL "$AG_URL" | sudo tar -xz -C /opt/antigravity --strip-components=1; then
log_error "Failed to extract Antigravity 2.0 App."
FAILED_STEPS+=("Antigravity installation")
return
fi
sudo ln -sfn /opt/antigravity/antigravity /usr/local/bin/antigravity
sudo mkdir -p /usr/share/applications /usr/share/icons/hicolor/512x512/apps
# Extract icon from app.asar
if [ -f "/opt/antigravity/resources/app.asar" ]; then
sudo python3 - /opt/antigravity/resources/app.asar /usr/share/icons/hicolor/512x512/apps/antigravity.png <<'PY'
import json, struct, sys
from pathlib import Path
asar = Path(sys.argv[1])
out = Path(sys.argv[2])
with asar.open('rb') as f:
f.read(4)
header_size = struct.unpack('<I', f.read(4))[0]
f.read(4)
json_size = struct.unpack('<I', f.read(4))[0]
header = json.loads(f.read(json_size).decode())
icon = header.get('files', {}).get('icon.png')
if icon:
with asar.open('rb') as f:
f.seek(8 + header_size + int(icon['offset']))
out.write_bytes(f.read(int(icon['size'])))
PY
fi
sudo bash -c 'cat > /usr/share/applications/antigravity.desktop' <<EOF
[Desktop Entry]
Name=Antigravity
Comment=Google Antigravity 2.0
Exec=/usr/local/bin/antigravity %U
Icon=antigravity
Terminal=false
Type=Application
Categories=Development;IDE;
StartupNotify=true
StartupWMClass=antigravity
EOF
log_info "Installing Antigravity IDE..."
sudo rm -rf /opt/antigravity-ide
sudo mkdir -p /opt/antigravity-ide
if ! curl -sL "$AG_IDE_URL" | sudo tar -xz -C /opt/antigravity-ide --strip-components=1; then
log_error "Failed to extract Antigravity IDE."
FAILED_STEPS+=("Antigravity IDE installation")
return
fi
sudo ln -sfn /opt/antigravity-ide/antigravity-ide /usr/local/bin/antigravity-ide
# Copy IDE icon from uncompressed resources
if [ -f "/opt/antigravity-ide/resources/app/resources/linux/code.png" ]; then
sudo cp "/opt/antigravity-ide/resources/app/resources/linux/code.png" /usr/share/icons/hicolor/512x512/apps/antigravity-ide.png
fi
sudo bash -c 'cat > /usr/share/applications/antigravity-ide.desktop' <<EOF
[Desktop Entry]
Name=Antigravity IDE
Comment=Google Antigravity IDE
Exec=/usr/local/bin/antigravity-ide %F
Icon=antigravity-ide
Terminal=false
Type=Application
Categories=Development;IDE;
StartupNotify=true
StartupWMClass=antigravity-ide
EOF
log_info "Refreshing desktop databases and icon caches..."
sudo update-desktop-database /usr/share/applications || true
sudo gtk-update-icon-cache -f -q /usr/share/icons/hicolor || true
log_info "Antigravity App and IDE installed successfully."
} }
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@@ -567,8 +657,8 @@ show_menu() {
echo "====================================================" echo "===================================================="
echo " Fedora Post-Install Script - Main Menu" echo " Fedora Post-Install Script - Main Menu"
echo "====================================================" echo "===================================================="
echo "1. Install Everything (Recommended)" echo "1. Install Everything (Prompts for Kernel)"
echo "2. Install Everything (No CachyOS Kernel)" echo "2. Install Everything for Work (No Gaming, No Custom Kernels)"
echo "3. Optimize DNF" echo "3. Optimize DNF"
echo "4. Install Fonts" echo "4. Install Fonts"
echo "5. Add Repositories (RPM Fusion)" echo "5. Add Repositories (RPM Fusion)"
@@ -588,19 +678,67 @@ show_menu() {
read -p "Enter your choice [0-16]: " choice read -p "Enter your choice [0-16]: " choice
} }
enable_work_mode() {
log_info "Work Mode selected: Removing gaming-related packages from installation list..."
local new_dnf=()
for p in "${DNF_PACKAGES[@]}"; do
if [[ "$p" != "steam" && "$p" != "lutris" ]]; then
new_dnf+=("$p")
fi
done
DNF_PACKAGES=("${new_dnf[@]}")
local new_flatpak=()
for p in "${FLATPAK_PACKAGES[@]}"; do
if [[ "$p" != "com.usebottles.bottles" && "$p" != "io.github.fastrizwaan.WineZGUI" && "$p" != "com.vysp3r.ProtonPlus" && "$p" != "org.waywallen.waywallen" && "$p" != "com.bambulab.BambuStudio" ]]; then
new_flatpak+=("$p")
fi
done
FLATPAK_PACKAGES=("${new_flatpak[@]}")
local new_ext=()
for p in "${GNOME_EXTENSIONS[@]}"; do
if [[ "$p" != "add-to-steam@pupper.space" && "$p" != "gamemodeshellextension@trsnaqe.com" ]]; then
new_ext+=("$p")
fi
done
GNOME_EXTENSIONS=("${new_ext[@]}")
}
# Run every installation step. Pass "skip_kernel" to leave out CachyOS. # Run every installation step. Pass "skip_kernel" to leave out CachyOS.
run_all() { run_all() {
if [ "$1" = "work_mode" ]; then
enable_work_mode
fi
optimize_dnf optimize_dnf
install_fonts install_fonts
install_repos install_repos
install_software install_software
if [ "$1" != "work_mode" ]; then
install_discord install_discord
fi
install_1password install_1password
install_PIA install_PIA
install_topgrade install_topgrade
if [ "$1" != "skip_kernel" ]; then if [ "$1" != "skip_kernel" ] && [ "$1" != "work_mode" ]; then
if [ "$1" = "ask_kernel" ]; then
echo ""
echo "Which kernel would you like to install?"
echo "1. CachyOS Kernel"
echo "2. P03 Kernel"
echo "3. Stock Fedora"
read -p "Select a kernel [1-3]: " kernel_choice
case $kernel_choice in
1) install_cachyos ;;
2) install_p03 ;;
3) log_info "Keeping Stock Fedora kernel. Skipping custom kernel installation." ;;
*) log_warn "Invalid choice. Keeping Stock Fedora kernel." ;;
esac
else
install_cachyos install_cachyos
fi fi
fi
install_linuxtoys install_linuxtoys
install_shell_env install_shell_env
install_gnome_extensions install_gnome_extensions
@@ -637,11 +775,11 @@ while true; do
show_menu show_menu
case $choice in case $choice in
1) 1)
run_all run_all ask_kernel
break break
;; ;;
2) 2)
run_all skip_kernel run_all work_mode
break break
;; ;;
3) optimize_dnf ;; 3) optimize_dnf ;;