v3-revamp-fedora

This commit is contained in:
2026-07-06 17:22:03 +02:00
parent 3509d25072
commit e2a84e8c48
3 changed files with 68 additions and 85 deletions
+31 -27
View File
@@ -1,44 +1,40 @@
#!/bin/bash
set -euo pipefail
#------------------------------------------
# Color helpers (printf-safe, no tput)
#------------------------------------------
RED="\033[0;31m"
GREEN="\033[0;32m"
YELLOW="\033[0;33m"
CYAN="\033[0;36m"
GRAY="\033[0;37m"
BOLD="\033[1m"
RESET="\033[0m"
# Source parent definitions (adjust path if needed)
source "$(dirname "$0")/../main_script.sh"
# Disable colors if output is not a terminal
if [ ! -t 1 ]; then
RED="" GREEN="" YELLOW="" CYAN="" GRAY="" BOLD="" RESET=""
fi
color_yellow() { printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
color_cyan() { printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
color_red() { printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
color_green() { printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
color_gray() { printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
#------------------------------------------
# Use exported variables from main detection script
#------------------------------------------
OS="${DETECTED_OS:-unknown}"
DDE="${DETECTED_DE:-unknown}"
# Map the exported variables to your local names with fallbacks to satisfy set -u
OS="${DETECTED_OS:-fedora}"
DE="${SELECTED_DE:-none}"
TWM="${SELECTED_TWM:-none}"
SYS_INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo
color_cyan "Starting Fedora Minimal setup..."
echo
#------------------------------------------
# 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
color_cyan "Removing packages: ${packages_to_remove[*]}"
sudo dnf remove -y "${packages_to_remove[@]}"
fi
}
#------------------------------------------
# 1. Base Dependencies & Repos
#------------------------------------------
@@ -46,6 +42,8 @@ color_cyan; echo "Installing base dependencies..."
# dnf-plugins-core is required for COPR
install_packages dnf-plugins-core wget
pause_if_debug
#------------------------------------------
# 2. Main Package Installation
#------------------------------------------
@@ -63,6 +61,8 @@ install_packages \
powertop inxi acpi plocate nm-connection-editor \
python3-pylint qt6-qtsvg qt6-qtvirtualkeyboard qt6-qtmultimedia
pause_if_debug
# 2. Inject the correct Polkit agent & PeaZip based on environment
color_cyan; echo "Tailoring toolkits for $DE / $TWM..."
if [[ "$DE" == "plasma" || "$TWM" == "hyprland" ]]; then
@@ -77,6 +77,8 @@ if ! command -v starship &> /dev/null; then
curl -sS https://starship.rs/install.sh | sh -s -- -y
fi
pause_if_debug
#------------------------------------------
# 3. Fonts (RobotoMono Nerd Font)
#------------------------------------------
@@ -95,6 +97,8 @@ else
color_yellow; echo "RobotoMono Nerd Font already installed."
fi
pause_if_debug
#------------------------------------------
# 4. Enable Services
#------------------------------------------