v3-revamp-fedora
This commit is contained in:
+51
-26
@@ -17,21 +17,21 @@ if [ ! -t 1 ]; then
|
|||||||
RED="" GREEN="" YELLOW="" CYAN="" GRAY="" BOLD="" RESET=""
|
RED="" GREEN="" YELLOW="" CYAN="" GRAY="" BOLD="" RESET=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
color_yellow() { printf '%b' "$YELLOW"; }
|
# Updated functions to cleanly accept and print text strings
|
||||||
color_cyan() { printf '%b' "$CYAN"; }
|
color_yellow() { printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
|
||||||
color_red() { printf '%b' "$RED"; }
|
color_cyan() { printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
|
||||||
color_green() { printf '%b' "$GREEN"; }
|
color_red() { printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
|
||||||
color_gray() { printf '%b' "$GRAY"; }
|
color_green() { printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
|
||||||
color_reset() { printf '%b' "$RESET"; }
|
color_gray() { printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
|
||||||
|
|
||||||
#------------------------------------------
|
#------------------------------------------
|
||||||
# Use exported variables from main detection script
|
# Use exported variables from main detection script
|
||||||
#------------------------------------------
|
#------------------------------------------
|
||||||
OS="${DETECTED_OS}"
|
OS="${DETECTED_OS:-unknown}"
|
||||||
DDE="${DETECTED_DE:-}"
|
DDE="${DETECTED_DE:-unknown}"
|
||||||
DE="${SELECTED_DE:-none}"
|
DE="${SELECTED_DE:-none}"
|
||||||
TWM="${SELECTED_TWM:-none}"
|
TWM="${SELECTED_TWM:-none}"
|
||||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
SYS_INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
#------------------------------------------
|
#------------------------------------------
|
||||||
@@ -40,33 +40,59 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
install_packages() { sudo dnf install -y "$@"; }
|
install_packages() { sudo dnf install -y "$@"; }
|
||||||
is_package_installed() { rpm -q "$@" &>/dev/null; }
|
is_package_installed() { rpm -q "$@" &>/dev/null; }
|
||||||
|
|
||||||
|
detect_de() {
|
||||||
|
echo "${XDG_CURRENT_DESKTOP:-${DESKTOP_SESSION:-}}"
|
||||||
|
}
|
||||||
|
|
||||||
|
detect_display_manager() {
|
||||||
|
if systemctl is-active --quiet sddm; then
|
||||||
|
echo "sddm"
|
||||||
|
elif systemctl is-active --quiet lightdm; then
|
||||||
|
echo "lightdm"
|
||||||
|
elif systemctl is-active --quiet gdm; then
|
||||||
|
echo "gdm"
|
||||||
|
else
|
||||||
|
echo "none"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
enable_graphical_target() {
|
||||||
|
sudo systemctl set-default graphical.target
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
# Main Execution Flow
|
||||||
|
#------------------------------------------
|
||||||
|
echo
|
||||||
color_yellow "Starting XFCE installation..."
|
color_yellow "Starting XFCE installation..."
|
||||||
|
|
||||||
CURRENT_DE="$(detect_de)"
|
CURRENT_DE="$(detect_de)"
|
||||||
CURRENT_DM="$(detect_display_manager)"
|
CURRENT_DM="$(detect_display_manager)"
|
||||||
|
|
||||||
if [[ -z "$CURRENT_DE" ]]; then
|
if [[ -z "$CURRENT_DE" || "$CURRENT_DE" == "none" ]]; then
|
||||||
color_cyan -e "No Desktop Environment detected. Installing XFCE (light setup with SDDM)..."
|
color_cyan "No Desktop Environment detected. Installing XFCE (light setup with SDDM)..."
|
||||||
|
|
||||||
install_packages sddm xfce4 xfce4-goodies
|
install_packages sddm xfce4-session xfce4-settings xfwm4 xfce4-panel xfdesktop Thunar xfce4-goodies
|
||||||
enable_graphical_target
|
enable_graphical_target
|
||||||
|
sudo systemctl enable sddm
|
||||||
|
|
||||||
color_green -e "XFCE with SDDM installed successfully. You can reboot now to start XFCE."
|
color_green "XFCE with SDDM installed successfully. You can reboot now to start XFCE."
|
||||||
else
|
else
|
||||||
color_cyan -e "Detected existing Desktop Environment: $CURRENT_DE"
|
color_cyan "Detected existing Desktop Environment: $CURRENT_DE"
|
||||||
|
|
||||||
if [[ "$CURRENT_DM" == "lightdm" ]]; then
|
if [[ "$CURRENT_DM" == "lightdm" ]]; then
|
||||||
color_yellow -e "LightDM is currently active. Replacing with SDDM..."
|
color_yellow "LightDM is currently active. Replacing with SDDM..."
|
||||||
|
|
||||||
sudo systemctl disable lightdm
|
sudo systemctl disable lightdm
|
||||||
sudo pacman -Rns lightdm lightdm-gtk-greeter
|
sudo dnf remove -y lightdm lightdm-gtk-greeter
|
||||||
|
|
||||||
install_packages sddm
|
install_packages sddm
|
||||||
|
sudo systemctl enable sddm
|
||||||
enable_graphical_target
|
enable_graphical_target
|
||||||
|
|
||||||
color_green -e "LightDM removed and replaced with SDDM."
|
color_green "LightDM removed and replaced with SDDM."
|
||||||
else
|
else
|
||||||
color_cyan -e "Current display manager: ${CURRENT_DM:-none}. Leaving unchanged."
|
color_cyan "Current display manager: ${CURRENT_DM}. Leaving unchanged."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -83,22 +109,21 @@ if [[ "${DE}" == "xfce" || "${DDE}" == "xfce" ]]; then
|
|||||||
install_packages xfce4-settings
|
install_packages xfce4-settings
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set fonts
|
# Set fonts via xfconf-query
|
||||||
# Wait for xfconf to be available (only needed if running inside the same session)
|
|
||||||
if command -v xfconf-query >/dev/null 2>&1; then
|
if command -v xfconf-query >/dev/null 2>&1; then
|
||||||
# Interface font (UI)
|
# Interface font (UI)
|
||||||
xfconf-query -c xsettings -p /Gtk/FontName -s "RobotoMono Nerd Font Regular 10"
|
xfconf-query -c xsettings -p /Gtk/FontName -s "RobotoMono Nerd Font Regular 10" || true
|
||||||
# Monospace font (terminals, editors)
|
# Monospace font (terminals, editors)
|
||||||
xfconf-query -c xsettings -p /Gtk/MonospaceFontName -s "RobotoMono Nerd Font Mono Regular 10"
|
xfconf-query -c xsettings -p /Gtk/MonospaceFontName -s "RobotoMono Nerd Font Mono Regular 10" || true
|
||||||
|
|
||||||
color_green "XFCE fonts updated successfully!"
|
color_green "XFCE fonts updated successfully!"
|
||||||
else
|
else
|
||||||
color_yellow "xfconf-query not found — skipping XFCE font config (will apply at first login)."
|
color_yellow "xfconf-query not found — skipping XFCE font config (will apply at first login)."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set default terminal
|
# Set default terminal to Alacritty
|
||||||
if command -v alacritty >/dev/null 2>&1; then
|
if command -v alacritty >/dev/null 2>&1; then
|
||||||
mkdir -p "$HOME/.config/xfce4/"
|
mkdir -p "$HOME/.config/xfce4"
|
||||||
HELPERS_FILE="$HOME/.config/xfce4/helpers.rc"
|
HELPERS_FILE="$HOME/.config/xfce4/helpers.rc"
|
||||||
|
|
||||||
touch "$HELPERS_FILE"
|
touch "$HELPERS_FILE"
|
||||||
@@ -116,9 +141,9 @@ if [[ "${DE}" == "xfce" || "${DDE}" == "xfce" ]]; then
|
|||||||
else
|
else
|
||||||
echo "TerminalEmulatorCommand=alacritty" >> "$HELPERS_FILE"
|
echo "TerminalEmulatorCommand=alacritty" >> "$HELPERS_FILE"
|
||||||
fi
|
fi
|
||||||
color_green "XFCE defeault terminal set to alacritty!"
|
color_green "XFCE default terminal set to alacritty!"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# End of script
|
# End of script
|
||||||
color_green -e "XFCE / SDDM setup completed."
|
color_green "XFCE / SDDM setup completed."
|
||||||
Reference in New Issue
Block a user