script improvements

This commit is contained in:
2026-04-23 09:39:06 +02:00
parent 2191db7a43
commit 0a735a2690
5 changed files with 218 additions and 419 deletions
+21 -10
View File
@@ -28,13 +28,15 @@ color_reset() { printf '%b' "$RESET"; }
##########################
# Script Version Selection
##########################
SCRIPT_VERSION="${SCRIPT_VERSION:-v2}" # Default to v2 if not set
echo
echo "Select script version:"
echo " 1) v1 (legacy)"
echo " 2) v2 (stable)"
read -rp "Enter choice [1/2] (default: 2): " ver_choice
# Added a 10-second timeout and default to 2
if ! read -t 10 -rp "Enter choice [1/2] (default: 2): " ver_choice; then
ver_choice=2
echo -e "\nTimeout reached, defaulting to v2."
fi
case "$ver_choice" in
1) SCRIPT_VERSION="v1" ;;
*) SCRIPT_VERSION="v2" ;;
@@ -140,12 +142,17 @@ if [[ -n "$DE" ]]; then
else
echo
echo "No Desktop Environment detected. Select one to install:"
echo "No Desktop Environment detected. Select one to install:"
while true; do
echo " 1) XFCE"
echo " 2) Plasma"
echo " 3) GNOME"
echo " x) None (default)"
read -rp "Enter choice [1/2/3/x] (default: x): " choice
# Added timeout to avoid hanging
if ! read -t 15 -rp "Enter choice [1/2/3/x] (default: x): " choice; then
choice="x"
fi
case "${choice,,}" in
1) DE="xfce"; break ;;
2) DE="plasma"; break ;;
@@ -173,7 +180,6 @@ echo "################################################################"
color_reset
echo
TWM="none"
while true; do
echo
echo "Select a tiling window manager:"
@@ -181,13 +187,16 @@ while true; do
echo " 2) Hyprland"
echo " 3) Niri"
echo " x) None (default)"
read -rp "Enter choice [1/2/x] (default: x): " choice
if ! read -t 15 -rp "Enter choice [1/2/3/x] (default: x): " choice; then
choice="x"
fi
case "${choice,,}" in
1) TWM="chadwm"; break ;;
2) TWM="hyprland"; break ;;
3) TWM="niri"; break ;;
x|"") TWM="none"; break ;;
*) echo "Invalid option. Please enter 1, 2, or x." ;;
*) echo "Invalid option. Please enter 1, 2, 3 or x." ;;
esac
done
@@ -209,7 +218,6 @@ echo "################################################################"
color_reset
echo
INSTALL_LEVEL="minimal" # default
while true; do
echo
echo "Select installation level:"
@@ -217,7 +225,10 @@ while true; do
echo " 2) full"
echo " 3) workstation"
echo " 4) server"
read -rp "Enter choice [1/2/3/4] (default: 1): " choice
if ! read -t 15 -rp "Enter choice [1/2/3/4] (default: 1): " choice; then
choice="1"
fi
case "$choice" in
1|"") INSTALL_LEVEL="minimal"; break ;;
2) INSTALL_LEVEL="full"; break ;;