arch started

This commit is contained in:
[yuri]
2025-11-11 16:45:42 +01:00
parent db28365a6c
commit 9a38c02135
4 changed files with 298 additions and 131 deletions

108
v2/arch-xfce.sh Executable file
View File

@@ -0,0 +1,108 @@
#!/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"
# Disable colors if output is not a terminal
if [ ! -t 1 ]; then
RED="" GREEN="" YELLOW="" CYAN="" GRAY="" BOLD="" RESET=""
fi
say_red() { printf "\n"; printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
say_green() { printf "\n"; printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
say_yellow() { printf "\n"; printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
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}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
##########################
# Helper functions
##########################
install_packages() {
sudo pacman -S --noconfirm --needed "$1"
}
remove_packages() {
sudo pacman -Rs --noconfirm "$1"
}
is_package_installed() {
pacman -Qi "$1" &>/dev/null
}
detect_de() {
if command -v xfce4-session >/dev/null 2>&1; then
echo "xfce"
else
echo ""
fi
}
detect_display_manager() {
if [ -f /etc/X11/default-display-manager ]; then
basename "$(cat /etc/X11/default-display-manager)"
else
echo ""
fi
}
enable_graphical_target() {
sudo systemctl enable sddm
sudo systemctl set-default graphical.target
}
##########################
# Start installation
##########################
say_yellow -e "Starting XFCE installation..."
CURRENT_DE="$(detect_de)"
CURRENT_DM="$(detect_display_manager)"
if [[ -z "$CURRENT_DE" ]]; then
say_cyan -e "No Desktop Environment detected. Installing XFCE (light setup with SDDM)..."
install_packages sddm xfce4 xfce4-goodies
enable_graphical_target
say_green -e "XFCE with SDDM installed successfully. You can reboot now to start XFCE."
else
say_cyan -e "Detected existing Desktop Environment: $CURRENT_DE"
if [[ "$CURRENT_DM" == "lightdm" ]]; then
say_yellow -e "LightDM is currently active. Replacing with SDDM..."
sudo systemctl disable lightdm
sudo apt purge -y lightdm lightdm-gtk-greeter
install_packages sddm
enable_graphical_target
say_green -e "LightDM removed and replaced with SDDM."
else
say_cyan -e "Current display manager: ${CURRENT_DM:-none}. Leaving unchanged."
fi
fi
# End of script
say_green -e "XFCE / SDDM setup completed."