setup: move DE selection to its own TUI screen

Remove the 'de' checkbox from the component checklist and always show
the desktop environment menu as a dedicated step between component and
app selection. Choosing 'none' or pressing Esc skips DE installation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
The_miro 2026-05-18 12:05:25 +02:00
parent 9cde41ddde
commit 32a84e8edf
1 changed files with 16 additions and 20 deletions

View File

@ -93,7 +93,7 @@ count_steps() {
[[ "$c" == *"core"* ]] && TOTAL=$(( TOTAL + 1 )) [[ "$c" == *"core"* ]] && TOTAL=$(( TOTAL + 1 ))
[[ "$c" == *"svc"* ]] && TOTAL=$(( TOTAL + 1 )) [[ "$c" == *"svc"* ]] && TOTAL=$(( TOTAL + 1 ))
[[ "$c" == *"shell"* ]] && TOTAL=$(( TOTAL + 1 )) [[ "$c" == *"shell"* ]] && TOTAL=$(( TOTAL + 1 ))
[[ "$c" == *"de"* && "$de" != "none" ]] && TOTAL=$(( TOTAL + 1 )) [[ "$de" != "none" ]] && TOTAL=$(( TOTAL + 1 ))
[[ "$a" == *"ollama"* ]] && TOTAL=$(( TOTAL + 1 )) [[ "$a" == *"ollama"* ]] && TOTAL=$(( TOTAL + 1 ))
[[ "$a" == *"llama-cpp"* ]] && TOTAL=$(( TOTAL + 1 )) [[ "$a" == *"llama-cpp"* ]] && TOTAL=$(( TOTAL + 1 ))
[[ "$a" == *"open-webui"* ]] && TOTAL=$(( TOTAL + 1 )) [[ "$a" == *"open-webui"* ]] && TOTAL=$(( TOTAL + 1 ))
@ -162,20 +162,17 @@ dialog --backtitle "$BACKTITLE" \
# ── Component selection ─────────────────────────────────────────────────────── # ── Component selection ───────────────────────────────────────────────────────
COMPONENTS=$(dialog --backtitle "$BACKTITLE" \ COMPONENTS=$(dialog --backtitle "$BACKTITLE" \
--title " Select Components " \ --title " Select Components " \
--checklist "Space toggles · Enter confirms · Esc quits" 16 68 5 \ --checklist "Space toggles · Enter confirms · Esc quits" 15 68 4 \
"pkg" "Package managers yay · nvm · rust" on \ "pkg" "Package managers yay · nvm · rust" on \
"core" "Core packages 100+ base system packages" on \ "core" "Core packages 100+ base system packages" on \
"svc" "Core services NetworkManager · cronie · fail2ban" on \ "svc" "Core services NetworkManager · cronie · fail2ban" on \
"shell" "Shell setup zsh · nvim · yazi · micro · starship" on \ "shell" "Shell setup zsh · nvim · yazi · micro · starship" on \
"de" "Desktop environment (choose on next screen)" off \
3>&1 1>&2 2>&3) || { clear; echo "Aborted."; exit 0; } 3>&1 1>&2 2>&3) || { clear; echo "Aborted."; exit 0; }
# ── DE selection ────────────────────────────────────────────────────────────── # ── DE selection ──────────────────────────────────────────────────────────────
DE="none" DE=$(dialog --backtitle "$BACKTITLE" \
if [[ "$COMPONENTS" == *"de"* ]]; then
DE=$(dialog --backtitle "$BACKTITLE" \
--title " Desktop Environment " \ --title " Desktop Environment " \
--menu "Select a desktop environment:" 20 70 8 \ --menu "Select a desktop environment · Esc / none to skip:" 20 70 8 \
"hyprland" "Hyprland — Wayland WM, full setup (primary)" \ "hyprland" "Hyprland — Wayland WM, full setup (primary)" \
"sway" "Sway — Wayland tiling WM" \ "sway" "Sway — Wayland tiling WM" \
"kde-plasma" "KDE Plasma — feature-rich Wayland/X11 DE" \ "kde-plasma" "KDE Plasma — feature-rich Wayland/X11 DE" \
@ -185,7 +182,6 @@ if [[ "$COMPONENTS" == *"de"* ]]; then
"lxqt" "LXQt — lightweight Qt X11 DE" \ "lxqt" "LXQt — lightweight Qt X11 DE" \
"none" "Skip DE installation" \ "none" "Skip DE installation" \
3>&1 1>&2 2>&3) || DE="none" 3>&1 1>&2 2>&3) || DE="none"
fi
# ── Apps selection ──────────────────────────────────────────────────────────── # ── Apps selection ────────────────────────────────────────────────────────────
SELECTED_APPS=$(dialog --backtitle "$BACKTITLE" \ SELECTED_APPS=$(dialog --backtitle "$BACKTITLE" \
@ -240,7 +236,7 @@ SUMMARY=""
[[ "$COMPONENTS" == *"core"* ]] && SUMMARY+=" ✦ Core packages\n" [[ "$COMPONENTS" == *"core"* ]] && SUMMARY+=" ✦ Core packages\n"
[[ "$COMPONENTS" == *"svc"* ]] && SUMMARY+=" ✦ Core services\n" [[ "$COMPONENTS" == *"svc"* ]] && SUMMARY+=" ✦ Core services\n"
[[ "$COMPONENTS" == *"shell"* ]] && SUMMARY+=" ✦ Shell setup\n" [[ "$COMPONENTS" == *"shell"* ]] && SUMMARY+=" ✦ Shell setup\n"
[[ "$COMPONENTS" == *"de"* && "$DE" != "none" ]] && SUMMARY+=" ✦ Desktop environment: $DE\n" [[ "$DE" != "none" ]] && SUMMARY+=" ✦ Desktop environment: $DE\n"
if [[ -n "$SELECTED_APPS" ]]; then if [[ -n "$SELECTED_APPS" ]]; then
SUMMARY+="\n Applications:\n" SUMMARY+="\n Applications:\n"
@ -300,7 +296,7 @@ count_steps "$COMPONENTS" "$DE" "$SELECTED_APPS"
[[ "$COMPONENTS" == *"svc"* ]] && run_module "Core Services" "$MODULES/core.sh" [[ "$COMPONENTS" == *"svc"* ]] && run_module "Core Services" "$MODULES/core.sh"
[[ "$COMPONENTS" == *"shell"* ]] && run_module "Shell Setup" "$MODULES/shell-setup.sh" [[ "$COMPONENTS" == *"shell"* ]] && run_module "Shell Setup" "$MODULES/shell-setup.sh"
if [[ "$COMPONENTS" == *"de"* && "$DE" != "none" ]]; then if [[ "$DE" != "none" ]]; then
case "$DE" in case "$DE" in
hyprland) run_module "Hyprland" "$MODULES/Desktop-Environments/hyprland.sh" ;; hyprland) run_module "Hyprland" "$MODULES/Desktop-Environments/hyprland.sh" ;;
sway) run_module "Sway" "$MODULES/Desktop-Environments/sway.sh" ;; sway) run_module "Sway" "$MODULES/Desktop-Environments/sway.sh" ;;