fix(Calamares): Installater will ask the desktop env before the calamares install

- The installer is still W.I.P
This commit is contained in:
2026-06-04 23:30:33 +02:00
parent a7a5055ee8
commit 98d47d497c
25 changed files with 700 additions and 179 deletions
+41
View File
@@ -0,0 +1,41 @@
#!/bin/bash
# ============================================================
# FWS — Sélecteur d'environnement de bureau (LIVE uniquement)
#
# Le paquet calamares (AUR) ne compile PAS le module packagechooser :
# on choisit donc le bureau ICI, dans le live, AVANT de lancer Calamares.
# Le choix est écrit dans /run/fws-desktop, lu ensuite par :
# - le module Calamares fws-desktop-choice (validation),
# - shellprocess.conf → /usr/local/bin/fws-desktop-init-<bureau>.
# ============================================================
set -u
STATE=/run/fws-desktop
DEFAULT=xfce
VALID_RE='^(xfce|kde|gnome|hyprland)$'
choice=""
# Dialogue graphique si zenity + X sont disponibles ; sinon repli silencieux.
if command -v zenity >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then
choice="$(zenity --list --radiolist \
--title="FWS — Environnement de bureau" \
--text="Choisissez le bureau à installer :" \
--width=560 --height=360 \
--column="Choix" --column="id" --column="Bureau" \
--hide-column=2 --print-column=2 \
TRUE xfce "Xfce — léger, stable et rapide (recommandé)" \
FALSE kde "KDE Plasma — moderne et très personnalisable" \
FALSE gnome "GNOME — épuré et intuitif" \
FALSE hyprland "Hyprland — compositeur Wayland dynamique" \
2>/dev/null)"
fi
# Normalisation : toute valeur vide / annulée / invalide → bureau par défaut.
choice="$(printf '%s' "$choice" | tr -d '[:space:]')"
if ! printf '%s' "$choice" | grep -Eq "$VALID_RE"; then
choice="$DEFAULT"
fi
printf '%s' "$choice" > "$STATE"
exit 0