117 lines
4.0 KiB
Bash
Executable File
117 lines
4.0 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
##########################
|
|
# Color helpers (printf-safe, no tput)
|
|
##########################
|
|
# ... (Keep your existing color helper functions here) ...
|
|
|
|
##########################
|
|
# Use exported variables
|
|
##########################
|
|
OS="${DETECTED_OS:-fedora}"
|
|
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; }
|
|
|
|
remove_packages() {
|
|
local packages_to_remove=()
|
|
for pkg in "$@"; do
|
|
if is_package_installed "$pkg"; then
|
|
packages_to_remove+=("$pkg")
|
|
fi
|
|
done
|
|
|
|
if [ ${#packages_to_remove[@]} -gt 0 ]; then
|
|
say_cyan "Removing packages: ${packages_to_remove[*]}"
|
|
sudo dnf remove -y "${packages_to_remove[@]}"
|
|
fi
|
|
}
|
|
|
|
say_yellow "Starting Fedora minimal setup..."
|
|
|
|
# Create user directories
|
|
mkdir -p "$HOME"/{.bin,.fonts,.icons,.themes,DATA} "$HOME/.local/share/"{icons,themes,applications} "$HOME/.config/"{autostart,gtk-{3.0,4.0},variety,fish,neofetch}
|
|
|
|
#################################
|
|
# 1. Driver and Kernel Cleanup
|
|
#################################
|
|
# Fedora handles kernel removal via dnf. We generally want to keep 'kernel' and 'kernel-core'.
|
|
say_yellow "Cleaning up unwanted drivers/firmware..."
|
|
# Fedora names these differently; usually broadcom-wl or specific firmware packages
|
|
remove_packages broadcom-wl akmod-wl
|
|
|
|
# Note: On Fedora, removing video drivers like 'vesa' or 'fbdev' isn't as critical
|
|
# as Arch, but we can target specific hardware-support packages if needed.
|
|
remove_packages xorg-x11-drv-fbdev xorg-x11-drv-vesa
|
|
|
|
#################################
|
|
# 2. Install Essential Tools
|
|
#################################
|
|
say_cyan "Installing essential Fedora tools..."
|
|
|
|
# Removed: pacmanlogviewer, paru, yay, pamac, reflector (Arch specific)
|
|
# Added: dnf-plugins-core (essential for copr/config-manager)
|
|
install_packages dnf-plugins-core wget curl nano fastfetch lolcat bash-completion \
|
|
starship alacritty hwinfo lshw duf man-db tree xdg-user-dirs rsync time bat \
|
|
unzip chromium thunar thunar-archive-plugin thunar-volman polkit-gnome ntp
|
|
|
|
# disk-tools & archive-managers
|
|
install_packages baobab gvfs-smb hddtemp squashfs-tools \
|
|
zip gzip p7zip unace unrar file-roller
|
|
|
|
# theming
|
|
install_packages feh font-manager
|
|
|
|
# System Utilities
|
|
install_packages dconf-editor hardinfo hw-probe logrotate lsb_release \
|
|
powertop inxi acpi plocate nm-connection-editor python3-pylint
|
|
|
|
#################################
|
|
# 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..."
|
|
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."
|
|
else
|
|
say_yellow "RobotoMono Nerd Font already installed."
|
|
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
|
|
#################################
|
|
sudo systemctl enable --now fstrim.timer
|
|
# Fedora uses chronyd by default; usually already enabled.
|
|
sudo systemctl enable --now chronyd || true
|
|
|
|
say_green "Fedora Minimal setup completed." |