removed logging and fixed colors

This commit is contained in:
[yuri]
2025-11-10 15:16:05 +01:00
parent af8f6078cf
commit aa7f8e97d0
9 changed files with 14 additions and 69 deletions

View File

@@ -10,9 +10,6 @@ color_yellow() { printf '%b' "$YELLOW"; }
color_green() { printf '%b' "$GREEN"; }
color_reset() { printf '%b' "$RESET"; }
LOGFILE="${LOGFILE:-/tmp/debian-full.log}"
exec > >(tee -a "$LOGFILE") 2>&1
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OS="${DETECTED_OS:-debian}"

View File

@@ -14,9 +14,6 @@ color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
LOGFILE="${LOGFILE:-/tmp/debian-gnome.log}"
exec > >(tee -a "$LOGFILE") 2>&1
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OS="${DETECTED_OS:-debian}"
DDE="${DETECTED_DE:-}"

View File

@@ -10,9 +10,6 @@ color_yellow() { printf '%b' "$YELLOW"; }
color_green() { printf '%b' "$GREEN"; }
color_reset() { printf '%b' "$RESET"; }
LOGFILE="${LOGFILE:-/tmp/debian-hyprland.log}"
exec > >(tee -a "$LOGFILE") 2>&1
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OS="${DETECTED_OS:-debian}"

View File

@@ -13,9 +13,6 @@ color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
LOGFILE="${LOGFILE:-/tmp/debian-minimal.log}"
exec > >(tee -a "$LOGFILE") 2>&1
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OS="${DETECTED_OS:-debian}"
DE="${SELECTED_DE:-none}"

View File

@@ -15,12 +15,6 @@ color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
##########################
# Logging
##########################
LOGFILE="${LOGFILE:-/tmp/debian-plasma.log}"
exec > >(tee -a "$LOGFILE") 2>&1
##########################
# Variables
##########################

View File

@@ -10,9 +10,6 @@ color_yellow() { printf '%b' "$YELLOW"; }
color_green() { printf '%b' "$GREEN"; }
color_reset() { printf '%b' "$RESET"; }
LOGFILE="${LOGFILE:-/tmp/debian-server.log}"
exec > >(tee -a "$LOGFILE") 2>&1
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OS="${DETECTED_OS:-debian}"

View File

@@ -10,9 +10,6 @@ color_yellow() { printf '%b' "$YELLOW"; }
color_green() { printf '%b' "$GREEN"; }
color_reset() { printf '%b' "$RESET"; }
LOGFILE="${LOGFILE:-/tmp/debian-workstation.log}"
exec > >(tee -a "$LOGFILE") 2>&1
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OS="${DETECTED_OS:-debian}"

View File

@@ -12,11 +12,6 @@ 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
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
@@ -24,17 +19,9 @@ color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
##########################
# Optional logging
##########################
LOGFILE="${LOGFILE:-/tmp/debian-xfce.log}"
exec > >(tee -a "$LOGFILE") 2>&1
##########################
# Paths and variables
##########################
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OS="${DETECTED_OS:-debian}"
DDE="${DETECTED_DE:-}"
DE="${SELECTED_DE:-none}"
@@ -78,35 +65,33 @@ enable_graphical_target() {
##########################
# Start installation
##########################
echo "${YELLOW}Starting XFCE installation...${RESET}"
echo -e "${YELLOW}Starting XFCE installation...${RESET}"
CURRENT_DE="$(detect_de)"
CURRENT_DM="$(detect_display_manager)"
if [[ -z "$CURRENT_DE" ]]; then
echo "${CYAN}No Desktop Environment detected. Installing XFCE (light setup with SDDM)...${RESET}"
echo -e "${CYAN}No Desktop Environment detected. Installing XFCE (light setup with SDDM)...${RESET}"
install_packages sddm xfce4 xfce4-goodies
enable_graphical_target
echo "${GREEN}XFCE with SDDM installed successfully. You can reboot now to start XFCE.${RESET}"
echo -e "${GREEN}XFCE with SDDM installed successfully. You can reboot now to start XFCE.${RESET}"
else
echo "${CYAN}Detected existing Desktop Environment: $CURRENT_DE${RESET}"
echo -e "${CYAN}Detected existing Desktop Environment: $CURRENT_DE${RESET}"
if [[ "$CURRENT_DM" == "lightdm" ]]; then
echo "${YELLOW}LightDM is currently active. Replacing with SDDM...${RESET}"
echo -e "${YELLOW}LightDM is currently active. Replacing with SDDM...${RESET}"
sudo systemctl disable lightdm
sudo apt purge -y lightdm lightdm-gtk-greeter
install_packages sddm
enable_graphical_target
echo "${GREEN}LightDM removed and replaced with SDDM.${RESET}"
echo -e "${GREEN}LightDM removed and replaced with SDDM.${RESET}"
else
echo "${CYAN}Current display manager: ${CURRENT_DM:-none}. Leaving unchanged.${RESET}"
echo -e "${CYAN}Current display manager: ${CURRENT_DM:-none}. Leaving unchanged.${RESET}"
fi
fi
@@ -116,4 +101,4 @@ echo -e "[Autologin]\nSession=xfce.desktop" | sudo tee /etc/sddm.conf.d/10-xfce.
echo -e "[General]\nSession=xfce.desktop" | sudo tee /etc/sddm.conf.d/10-xfce-session.conf >/dev/null
# End of script
echo "${GREEN}XFCE / SDDM setup completed.${RESET}"
echo -e "${GREEN}XFCE / SDDM setup completed.${RESET}"