fix colors

This commit is contained in:
[yuri]
2025-11-10 15:54:48 +01:00
parent 58b72a37e9
commit ea55b1524b
9 changed files with 214 additions and 124 deletions

View File

@@ -2,27 +2,27 @@
set -euo pipefail
##########################
# Color helpers (no tput)
# 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'
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=''
RED="" GREEN="" YELLOW="" CYAN="" GRAY="" BOLD="" RESET=""
fi
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_gray() { printf '%b' "$GRAY"; }
color_reset() { printf '%b' "$RESET"; }
say_red() { printf "%b%s%b\n" "$RED" "$*" "$RESET"; }
say_green() { printf "%b%s%b\n" "$GREEN" "$*" "$RESET"; }
say_yellow() { printf "%b%s%b\n" "$YELLOW" "$*" "$RESET"; }
say_cyan() { printf "%b%s%b\n" "$CYAN" "$*" "$RESET"; }
say_gray() { printf "%b%s%b\n" "$GRAY" "$*" "$RESET"; }
say_bold() { printf "%b%s%b\n" "$BOLD" "$*" "$RESET"; }
##########################
# Use exported variables from main detection script
@@ -33,15 +33,14 @@ DE="${SELECTED_DE:-none}"
TWM="${SELECTED_TWM:-none}"
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
color_cyan
echo
echo "Starting Debian Chadwm setup..."
color_reset
echo "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
say_cyan "Starting Debian Chadwm setup..."
say_cyan "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
echo
# End of script
color_green; echo "Chadwm setup completed."; color_reset
say_green "Chadwm setup completed."
# Pause
read -n 1 -s -r -p "Press any key to continue"