diff --git a/configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/__pycache__/fws_desktop.cpython-314.pyc b/configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/__pycache__/fws_desktop.cpython-314.pyc new file mode 100644 index 0000000..5c8dabf Binary files /dev/null and b/configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/__pycache__/fws_desktop.cpython-314.pyc differ diff --git a/configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/fws_desktop.py b/configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/fws_desktop.py new file mode 100644 index 0000000..b92ab7e --- /dev/null +++ b/configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/fws_desktop.py @@ -0,0 +1,105 @@ +# FWS — Spoke « Desktop Environment » : nouvel onglet de choix du bureau. +# +# POURQUOI ICI (airootfs, pas dans le paquet anaconda) : Anaconda découvre les +# spokes au RUNTIME via collect()/collect_spokes (os.listdir du dossier des +# spokes puis import de chaque .py). Déposer ce fichier dans le dossier des +# spokes via l'overlay airootfs suffit donc à le faire apparaître — SANS rebuild +# du paquet anaconda (juste ./build.sh). Le glade associé est dans +# /usr/share/anaconda/ui/spokes/fws_desktop.glade (aussi via l'airootfs). +# +# ⚠ Le chemin /usr/lib/python3.14/... est couplé à la version de Python d'Arch +# (3.14 au moment du build d'anaconda). À mettre à jour si Python change de +# version majeure (en même temps que le rebuild d'anaconda de toute façon). +# +# FONCTION : afficher 5 choix (CLI/GNOME/KDE/Hyprland/XFCE) et écrire la clé +# choisie dans /tmp/fws-desktop. Le %post du kickstart lit ce fichier, fait +# « pacman -S » du bureau + d'un navigateur (Firefox), et active le display +# manager. « cli » (défaut) = aucun bureau, rien à installer. + +from pyanaconda.core.i18n import CN_, _ +from pyanaconda.ui.categories.software import SoftwareCategory +from pyanaconda.ui.gui.spokes import NormalSpoke + +__all__ = ["FWSDesktopSpoke"] + +# clé interne (écrite dans /tmp/fws-desktop) → libellé affiché dans le statut. +_CHOICES = [ + ("cli", _("Command line only (no desktop)")), + ("gnome", "GNOME"), + ("kde", "KDE Plasma"), + ("hyprland", "Hyprland"), + ("xfce", "XFCE"), +] +_DESKTOP_FILE = "/tmp/fws-desktop" + + +class FWSDesktopSpoke(NormalSpoke): + """Choix de l'environnement de bureau FWS (écrit /tmp/fws-desktop).""" + + builderObjects = ["fwsDesktopWindow"] + mainWidgetName = "fwsDesktopWindow" + uiFile = "spokes/fws_desktop.glade" + category = SoftwareCategory + icon = "preferences-desktop-display-symbolic" + title = CN_("GUI|Spoke", "_Desktop Environment") + + @staticmethod + def get_screen_id(): + """Identifiant unique de cet écran.""" + return "fws-desktop-selection" + + def __init__(self, *args): + NormalSpoke.__init__(self, *args) + self._choice = "cli" + self._radios = {} + + def initialize(self): + NormalSpoke.initialize(self) + for key, _label in _CHOICES: + self._radios[key] = self.builder.get_object("radio_" + key) + # Reprend un éventuel choix déjà écrit (revisite du spoke). + try: + with open(_DESKTOP_FILE) as fh: + val = fh.read().strip() + if val in self._radios: + self._choice = val + except OSError: + pass + + def refresh(self): + # Coche le bouton correspondant au choix courant. + rb = self._radios.get(self._choice) or self._radios.get("cli") + if rb is not None: + rb.set_active(True) + + def apply(self): + # Relit le bouton actif et persiste le choix pour le %post du kickstart. + for key, rb in self._radios.items(): + if rb is not None and rb.get_active(): + self._choice = key + break + try: + with open(_DESKTOP_FILE, "w") as fh: + fh.write(self._choice) + except OSError: + pass + + @property + def status(self): + for key, label in _CHOICES: + if key == self._choice: + return label + return _("Command line only (no desktop)") + + @property + def completed(self): + # « cli » est un défaut valide → le spoke n'est jamais bloquant. + return True + + @property + def mandatory(self): + return False + + @property + def ready(self): + return True diff --git a/configs/baseline/airootfs/usr/share/anaconda/ui/spokes/fws_desktop.glade b/configs/baseline/airootfs/usr/share/anaconda/ui/spokes/fws_desktop.glade new file mode 100644 index 0000000..00e6784 --- /dev/null +++ b/configs/baseline/airootfs/usr/share/anaconda/ui/spokes/fws_desktop.glade @@ -0,0 +1,153 @@ + + + + + + + False + True + True + DESKTOP ENVIRONMENT + + + + False + vertical + 6 + + + False + + + False + 6 + 6 + 6 + + + + + False + False + 0 + + + + + False + 12 + 0 + 0 + 0 + 48 + 24 + 24 + + + False + vertical + 8 + + + True + False + 0 + 12 + True + 60 + Choose the desktop environment to install. A web browser (Firefox) is installed automatically with any desktop. + + + False + True + 0 + + + + + Command line only (no desktop) + True + True + False + True + True + + + False + True + 1 + + + + + GNOME + True + True + False + True + radio_cli + + + False + True + 2 + + + + + KDE Plasma + True + True + False + True + radio_cli + + + False + True + 3 + + + + + Hyprland + True + True + False + True + radio_cli + + + False + True + 4 + + + + + XFCE + True + True + False + True + radio_cli + + + False + True + 5 + + + + + + + + + + + DESKTOP ENVIRONMENT + + + + diff --git a/configs/releng/airootfs/usr/share/anaconda/interactive-defaults.ks b/configs/releng/airootfs/usr/share/anaconda/interactive-defaults.ks index 91a1e5e..34e01cd 100644 --- a/configs/releng/airootfs/usr/share/anaconda/interactive-defaults.ks +++ b/configs/releng/airootfs/usr/share/anaconda/interactive-defaults.ks @@ -216,6 +216,8 @@ case "$DESK" in hyprland) PKGS="hyprland kitty wofi waybar sddm"; DM="sddm" ;; cli|*) PKGS="" ;; esac +# Navigateur de base ajouté DÈS QU'un bureau est choisi (jamais en CLI). +[ -n "$PKGS" ] && PKGS="$PKGS firefox" if [ -n "$PKGS" ]; then pacman-key --init &>/dev/null || true pacman-key --populate archlinux &>/dev/null || true