v3-fedora-renew

This commit is contained in:
2026-07-06 12:26:36 +02:00
parent 86c8d48fc4
commit d26c1035ba
2 changed files with 71 additions and 89 deletions
+23 -41
View File
@@ -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"
@@ -24,14 +24,14 @@ 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"; }
##########################
#------------------------------------------
# Use exported variables from main detection script
##########################
#------------------------------------------
OS="${DETECTED_OS}"
DDE="${DETECTED_DE}"
DE="${SELECTED_DE:-none}"
TWM="${SELECTED_TWM:-none}"
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
DE="${SELECTED_DE}"
TWM="${SELECTED_TWM}"
INSTALL_LEVEL="${INSTALL_LEVEL}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo
@@ -39,9 +39,9 @@ say_cyan "Starting Fedora setup..."
echo
say_gray "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
##########################
#------------------------------------------
# Helper functions
##########################
#------------------------------------------
install_packages() { sudo dnf install -y "$@"; }
is_package_installed() { rpm -q "$@" &>/dev/null; }
@@ -59,32 +59,26 @@ remove_packages() {
fi
}
##########################
#------------------------------------------
# 0. Ensure base is ready for installation
##########################
installed_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
pkg_dir="packages"
if [[ ! -d "$pkg_dir" ]]; then
say_red "Directory not found: $pkg_dir"
exit 1
fi
#------------------------------------------
if ! command -v curl >/dev/null 2>&1; then
say_yellow "curl is not installed. Installing..."
install_packages curl
fi
##########################
#------------------------------------------
# 1. Update and Enable Repos
##########################
#------------------------------------------
say_cyan "Optimizing DNF for speed..."
# 1. Enable fastest mirror (lowest latency)
# 2. Increase parallel downloads (allows downloading multiple packages at once)
# 3. Set a minimum rate to drop slow mirrors automatically
# $. Set dnf to set YES as default instead of NO
sudo dnf config-manager setopt fastestmirror=1
sudo dnf config-manager setopt max_parallel_downloads=20
sudo dnf config-manager setopt defaultyes=True
say_green "DNF optimized. Refreshing metadata..."
sudo dnf makecache --refresh
@@ -119,21 +113,9 @@ say_gray "Updating the system"
echo
sudo dnf update -y
##########################
# 2. Fix missing console font
##########################
say_yellow "Fix missing console font"
if grep -q FONT= /etc/vconsole.conf; then
say_green "Font is already set in /etc/vconsole.conf"
else
say_green "Setting console font in /etc/vconsole.conf"
echo 'FONT=gr737c-8x14' | sudo tee -a /etc/vconsole.conf
fi
##########################
#------------------------------------------
# 3. Detected OS / DE / TWM info
##########################
#------------------------------------------
say_yellow "Detected OS / Desktop Environment / Tiling Window Manager"
echo
say_gray "Installing OS-specific packages..."
@@ -141,9 +123,9 @@ say_gray "Selected DE: $DE"
say_gray "Selected TWM: $TWM"
say_gray "Installation Level: $INSTALL_LEVEL"
##########################
#------------------------------------------
# 4. Desktop Environment installation
##########################
#------------------------------------------
case "$DE" in
xfce|plasma|gnome)
say_yellow "Preparing to install $DE..."
@@ -161,9 +143,9 @@ case "$DE" in
;;
esac
##########################
#------------------------------------------
# 5. Tiling Window Manager installation
##########################
#------------------------------------------
case "$TWM" in
chadwm|hyprland|niri)
say_yellow "Installing $TWM..."
@@ -181,9 +163,9 @@ case "$TWM" in
;;
esac
##########################
#------------------------------------------
# 6. Installation level handling
##########################
#------------------------------------------
case "$INSTALL_LEVEL" in
minimal|full|workstation|server)
say_cyan "Installation level: $INSTALL_LEVEL"