v3-revamp-fedora
This commit is contained in:
+46
-66
@@ -1,9 +1,9 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
#------------------------------------------
|
||||
# Color helpers (printf-safe, no tput)
|
||||
##########################
|
||||
#------------------------------------------
|
||||
RED="\033[0;31m"
|
||||
GREEN="\033[0;32m"
|
||||
YELLOW="\033[0;33m"
|
||||
@@ -17,109 +17,89 @@ if [ ! -t 1 ]; then
|
||||
RED="" GREEN="" YELLOW="" CYAN="" GRAY="" BOLD="" RESET=""
|
||||
fi
|
||||
|
||||
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||
say_cyan() { printf "\n"; printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||
say_gray() { printf "\n"; printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||
say_bold() { printf "\n"; printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
|
||||
color_yellow() { printf '%b' "$YELLOW"; }
|
||||
color_cyan() { printf '%b' "$CYAN"; }
|
||||
color_red() { printf '%b' "$RED"; }
|
||||
color_green() { printf '%b' "$GREEN"; }
|
||||
color_reset() { printf '%b' "$RESET"; }
|
||||
|
||||
##########################
|
||||
#------------------------------------------
|
||||
# Use exported variables from main detection script
|
||||
##########################
|
||||
OS="${DETECTED_OS}"
|
||||
DDE="${DETECTED_DE}"
|
||||
#------------------------------------------
|
||||
OS="${DETECTED_OS:-unknown}"
|
||||
DDE="${DETECTED_DE:-unknown}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SYS_INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
##########################
|
||||
#------------------------------------------
|
||||
# Helper functions
|
||||
##########################
|
||||
#------------------------------------------
|
||||
install_packages() { sudo dnf install -y "$@"; }
|
||||
is_package_installed() { rpm -q "$@" &>/dev/null; }
|
||||
|
||||
##########################
|
||||
#------------------------------------------
|
||||
# 1. Base Dependencies & Repos
|
||||
##########################
|
||||
say_cyan "Installing base dependencies..."
|
||||
#------------------------------------------
|
||||
color_cyan; echo "Installing base dependencies..."; color_reset
|
||||
# dnf-plugins-core is required for COPR
|
||||
install_packages dnf-plugins-core curl wget git flatpak
|
||||
install_packages dnf-plugins-core wget
|
||||
|
||||
# Enable PeaZip via COPR
|
||||
say_cyan "Installing PeaZip (Qt6) via official RPM..."
|
||||
PZ_VER="11.0.0"
|
||||
PZ_FILE="peazip-${PZ_VER}.LINUX.Qt6-1.x86_64.rpm"
|
||||
PZ_URL="https://github.com/peazip/PeaZip/releases/download/${PZ_VER}/${PZ_FILE}"
|
||||
curl -L "$PZ_URL" -o "/tmp/$PZ_FILE"
|
||||
sudo dnf install -y "/tmp/$PZ_FILE"
|
||||
rm "/tmp/$PZ_FILE"
|
||||
|
||||
say_green "PeaZip ${PZ_VER} (Qt6) installed successfully."
|
||||
|
||||
##########################
|
||||
#------------------------------------------
|
||||
# 2. Main Package Installation
|
||||
##########################
|
||||
say_yellow "Installing essential tools..."
|
||||
#------------------------------------------
|
||||
color_yellow; echo "Installing essential tools..."; color_reset
|
||||
|
||||
# 1. Install universal base packages (minus the polkit agent)
|
||||
install_packages \
|
||||
fastfetch lolcat bash-completion alacritty \
|
||||
hwinfo lshw duf chrony polkit-kde-agent-1 \
|
||||
man-db tree xdg-user-dirs rsync time bat chromium \
|
||||
fastfetch bash-completion alacritty \
|
||||
hwinfo lshw duf chrony \
|
||||
man-db tree xdg-user-dirs rsync time bat \
|
||||
thunar thunar-archive-plugin thunar-volman \
|
||||
baobab gvfs-smb hddtemp squashfs-tools \
|
||||
zip gzip p7zip unace unrar file-roller peazip \
|
||||
zip gzip p7zip unace unrar xarchiver \
|
||||
feh gnome-font-viewer dconf-editor hardinfo2 lsb_release \
|
||||
powertop inxi acpi plocate nm-connection-editor \
|
||||
python3-pylint qt6-qtsvg qt6-qtvirtualkeyboard qt6-qtmultimedia
|
||||
|
||||
# 2. Inject the correct Polkit agent & PeaZip based on environment
|
||||
color_cyan; echo "Tailoring toolkits for $DE / $TWM..."; color_reset
|
||||
if [[ "$DE" == "plasma" || "$TWM" == "hyprland" ]]; then
|
||||
install_packages polkit-kde-agent-1 peazip-common peazip-qt6
|
||||
else
|
||||
# XFCE, GNOME, Niri, CHADWM (Uses lightweight generic toolkits)
|
||||
install_packages xfce-polkit peazip-common peazip-gtk3
|
||||
fi
|
||||
|
||||
if ! command -v starship &> /dev/null; then
|
||||
say_cyan "Installing Starship shell prompt..."
|
||||
color_cyan; echo "Installing Starship shell prompt..."; color_reset
|
||||
curl -sS https://starship.rs/install.sh | sh -s -- -y
|
||||
fi
|
||||
|
||||
#################################
|
||||
#------------------------------------------
|
||||
# 3. Fonts (RobotoMono Nerd Font)
|
||||
#################################
|
||||
#------------------------------------------
|
||||
FONT_DIR="$HOME/.local/share/fonts"
|
||||
DOWNLOAD_NAME="RobotoMono"
|
||||
if ! find "$FONT_DIR" -name "*RobotoMonoNerdFont*" | grep -q .; then
|
||||
say_yellow "Installing ${DOWNLOAD_NAME} Nerd Font..."
|
||||
color_yellow; echo "Installing ${DOWNLOAD_NAME} Nerd Font..."; color_reset
|
||||
mkdir -p "$FONT_DIR"
|
||||
FONT_ZIP="/tmp/${DOWNLOAD_NAME}.zip"
|
||||
curl -L "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/${DOWNLOAD_NAME}.zip" -o "$FONT_ZIP"
|
||||
unzip -oq "$FONT_ZIP" -d "$FONT_DIR"
|
||||
fc-cache -fv
|
||||
rm "$FONT_ZIP"
|
||||
say_green "${DOWNLOAD_NAME} installed."
|
||||
color_green; echo "${DOWNLOAD_NAME} installed."; color_reset
|
||||
else
|
||||
say_yellow "RobotoMono Nerd Font already installed."
|
||||
color_yellow; echo "RobotoMono Nerd Font already installed."; color_reset
|
||||
fi
|
||||
|
||||
#################################
|
||||
# 4. Chromium Configuration
|
||||
#################################
|
||||
CONF="$HOME/.config/chromium-flags.conf"
|
||||
mkdir -p "$(dirname "$CONF")"
|
||||
[[ ! -f "$CONF" ]] && touch "$CONF"
|
||||
|
||||
# Add OAuth IDs for Google Sync
|
||||
#
|
||||
OAUTH_ID="--oauth2-client-id=77185425430.apps.googleusercontent.com"
|
||||
OAUTH_SECRET="--oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT"
|
||||
|
||||
grep -qxF -- "$OAUTH_ID" "$CONF" || echo "$OAUTH_ID" >> "$CONF"
|
||||
grep -qxF -- "$OAUTH_SECRET" "$CONF" || echo "$OAUTH_SECRET" >> "$CONF"
|
||||
|
||||
say_green "Chromium flags configured."
|
||||
|
||||
#################################
|
||||
# 5. Enable Services
|
||||
#################################
|
||||
# Enable basic services
|
||||
say_cyan "Enabling services..."
|
||||
#------------------------------------------
|
||||
# 4. Enable Services
|
||||
#------------------------------------------
|
||||
color_cyan; echo "Enabling services..."; color_reset
|
||||
sudo systemctl enable --now fstrim.timer
|
||||
sudo systemctl enable --now chronyd || true
|
||||
|
||||
say_green "Fedora Minimal setup completed."
|
||||
color_green; echo "Fedora Minimal setup completed."; color_reset
|
||||
Reference in New Issue
Block a user