v3-revamp-fedora
This commit is contained in:
+19
-29
@@ -1,46 +1,26 @@
|
||||
#!/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}"
|
||||
DDE="${DETECTED_DE:-}"
|
||||
# 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}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-full}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
echo
|
||||
color_cyan "Starting Fedora Full setup..."
|
||||
echo
|
||||
|
||||
#------------------------------------------
|
||||
# Helper functions
|
||||
#------------------------------------------
|
||||
install_packages() { sudo dnf install -y "$@"; }
|
||||
is_package_installed() { rpm -q "$@" &>/dev/null; }
|
||||
|
||||
color_yellow "Starting full setup..."
|
||||
|
||||
# Run minimal first
|
||||
bash "$SCRIPT_DIR/fedora-minimal.sh"
|
||||
|
||||
@@ -51,6 +31,8 @@ install_packages arandr catfish galculator NetworkManager network-manager-applet
|
||||
# temp disabled packages
|
||||
# xfce4-indicator-plugin
|
||||
|
||||
pause_if_debug
|
||||
|
||||
# install SDDM-theme
|
||||
color_yellow "Installing SDDM Theme"
|
||||
|
||||
@@ -74,6 +56,8 @@ cd "$REPO_DIR" || {
|
||||
exit 1
|
||||
}
|
||||
|
||||
pause_if_debug
|
||||
|
||||
# Ensure NetworkManager manages all interfaces
|
||||
color_yellow "Ensuring NetworkManager service is enabled and running..."
|
||||
sudo systemctl enable --now NetworkManager
|
||||
@@ -93,12 +77,18 @@ sudo systemctl restart NetworkManager
|
||||
color_yellow "Waiting for NetworkManager to reconnect..."
|
||||
sleep 15
|
||||
|
||||
pause_if_debug
|
||||
|
||||
# Enable pipewire
|
||||
systemctl --user enable pipewire pipewire-pulse wireplumber
|
||||
|
||||
pause_if_debug
|
||||
|
||||
# replace bashrc
|
||||
color_yellow "making backup of bashrc"
|
||||
sudo cp -v /etc/skel/.bashrc /etc/skel/.bashrc.starburst
|
||||
|
||||
pause_if_debug
|
||||
|
||||
# End of script
|
||||
color_green "Full setup completed."
|
||||
|
||||
+31
-27
@@ -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
|
||||
#------------------------------------------
|
||||
|
||||
+18
-29
@@ -1,39 +1,20 @@
|
||||
#!/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
|
||||
|
||||
# Updated functions to cleanly accept and print text strings
|
||||
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}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
# Map the exported variables to your local names with fallbacks to satisfy set -u
|
||||
OS="${DETECTED_OS:-fedora}"
|
||||
DE="${SELECTED_DE:-xfce}"
|
||||
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 XFCE setup..."
|
||||
echo
|
||||
|
||||
#------------------------------------------
|
||||
# Helper functions
|
||||
#------------------------------------------
|
||||
@@ -101,6 +82,8 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
pause_if_debug
|
||||
|
||||
#------------------------------------------
|
||||
# XFCE-specific configuration
|
||||
#------------------------------------------
|
||||
@@ -114,6 +97,8 @@ if [[ "${DE}" == "xfce" || "${DDE}" == "xfce" ]]; then
|
||||
install_packages xfce4-settings
|
||||
fi
|
||||
|
||||
pause_if_debug
|
||||
|
||||
# Set fonts via xfconf-query
|
||||
if command -v xfconf-query >/dev/null 2>&1; then
|
||||
# Interface font (UI)
|
||||
@@ -126,6 +111,8 @@ if [[ "${DE}" == "xfce" || "${DDE}" == "xfce" ]]; then
|
||||
color_yellow "xfconf-query not found — skipping XFCE font config (will apply at first login)."
|
||||
fi
|
||||
|
||||
pause_if_debug
|
||||
|
||||
# Set default terminal to Alacritty
|
||||
if command -v alacritty >/dev/null 2>&1; then
|
||||
mkdir -p "$HOME/.config/xfce4"
|
||||
@@ -150,5 +137,7 @@ if [[ "${DE}" == "xfce" || "${DDE}" == "xfce" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
pause_if_debug
|
||||
|
||||
# End of script
|
||||
color_green "XFCE / SDDM setup completed."
|
||||
Reference in New Issue
Block a user