fix(Installer ─ Multi-Desktop): Fix Multi Desktop
This commit is contained in:
@@ -1,65 +1,8 @@
|
||||
---
|
||||
# Module packagechooser : sélection d'environnement de bureau
|
||||
# Un seul choix possible (boutons radio)
|
||||
|
||||
mode: required
|
||||
id: desktop
|
||||
|
||||
items:
|
||||
- id: xfce
|
||||
packages: []
|
||||
name:
|
||||
- locale: ""
|
||||
value: "Xfce (Recommandé)"
|
||||
description:
|
||||
- locale: ""
|
||||
value: "Léger, rapide et stable — déjà inclus dans l'ISO, aucun téléchargement."
|
||||
|
||||
- id: kde
|
||||
packages:
|
||||
- plasma-meta
|
||||
- konsole
|
||||
- dolphin
|
||||
- sddm
|
||||
name:
|
||||
- locale: ""
|
||||
value: "KDE Plasma"
|
||||
description:
|
||||
- locale: ""
|
||||
value: "Bureau moderne, riche en fonctionnalités et très personnalisable."
|
||||
|
||||
- id: gnome
|
||||
packages:
|
||||
- gnome
|
||||
- gdm
|
||||
name:
|
||||
- locale: ""
|
||||
value: "GNOME"
|
||||
description:
|
||||
- locale: ""
|
||||
value: "Interface épurée centrée sur la productivité."
|
||||
|
||||
- id: hyprland
|
||||
packages:
|
||||
- hyprland
|
||||
- xdg-desktop-portal-hyprland
|
||||
- xdg-desktop-portal-gtk
|
||||
- waybar
|
||||
- wofi
|
||||
- kitty
|
||||
- swaybg
|
||||
- swayidle
|
||||
- swaylock
|
||||
- xorg-xwayland
|
||||
- wl-clipboard
|
||||
- grim
|
||||
- slurp
|
||||
- qt5-wayland
|
||||
- qt6-wayland
|
||||
- sddm
|
||||
name:
|
||||
- locale: ""
|
||||
value: "Hyprland"
|
||||
description:
|
||||
- locale: ""
|
||||
value: "Compositeur Wayland dynamique — tiling Wayland (utilisateurs avancés)."
|
||||
# Minimal Calamares view module config for desktop selection
|
||||
# This tells Calamares to use our QML page from the branding folder.
|
||||
module: view
|
||||
name: desktop
|
||||
qml: "branding/fws/desktop.qml"
|
||||
title: "Choix de l'environnement"
|
||||
description: "Sélectionne le bureau à installer"
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Calamares job : lit le choix de bureau depuis GlobalStorage
|
||||
(packagechooser_desktop) et l'écrit dans /run/fws-desktop pour
|
||||
que shellprocess puisse appeler le bon fws-desktop-init-*.
|
||||
"""
|
||||
import libcalamares
|
||||
|
||||
VALID_DESKTOPS = {"xfce", "kde", "gnome", "hyprland"}
|
||||
FALLBACK = "xfce"
|
||||
|
||||
|
||||
def pretty_name():
|
||||
return "Sauvegarde du choix d'environnement de bureau"
|
||||
|
||||
|
||||
def run():
|
||||
gs = libcalamares.globalstorage
|
||||
|
||||
raw = gs.value("packagechooser_desktop")
|
||||
|
||||
# packagechooser peut renvoyer une str ou une liste selon la version
|
||||
if isinstance(raw, list):
|
||||
choice = raw[0] if raw else FALLBACK
|
||||
elif isinstance(raw, str):
|
||||
choice = raw.strip()
|
||||
else:
|
||||
choice = FALLBACK
|
||||
|
||||
if choice not in VALID_DESKTOPS:
|
||||
choice = FALLBACK
|
||||
|
||||
try:
|
||||
with open("/run/fws-desktop", "w") as fh:
|
||||
fh.write(choice)
|
||||
except OSError as exc:
|
||||
return (
|
||||
"Impossible d'écrire /run/fws-desktop",
|
||||
f"{exc}\nLe bureau sera xfce par défaut.",
|
||||
)
|
||||
|
||||
libcalamares.utils.debug(f"fws-desktop-choice : bureau sélectionné = {choice}")
|
||||
return None
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
type: "job"
|
||||
name: "fws-desktop-choice"
|
||||
interface: "python"
|
||||
script: "main.py"
|
||||
@@ -1,33 +0,0 @@
|
||||
---
|
||||
# packagechooser — un seul choix (radio buttons)
|
||||
# method: legacy → stocke l'id dans GlobalStorage["packagechooser_packagechooser"]
|
||||
# Les scripts fws-desktop-init-* gèrent l'installation réelle.
|
||||
|
||||
mode: required
|
||||
method: legacy
|
||||
|
||||
items:
|
||||
- id: cli
|
||||
packages: []
|
||||
name: "CLI uniquement"
|
||||
description: "Installation minimale en ligne de commande, sans interface graphique."
|
||||
|
||||
- id: kde
|
||||
packages: []
|
||||
name: "KDE Plasma"
|
||||
description: "Bureau moderne, hautement personnalisable et riche en fonctionnalités."
|
||||
|
||||
- id: gnome
|
||||
packages: []
|
||||
name: "GNOME"
|
||||
description: "Interface épurée et intuitive, centrée sur la productivité."
|
||||
|
||||
- id: xfce
|
||||
packages: []
|
||||
name: "Xfce"
|
||||
description: "Léger, rapide et stable. Idéal pour tous les systèmes, y compris les machines plus anciennes."
|
||||
|
||||
- id: hyprland
|
||||
packages: []
|
||||
name: "Hyprland"
|
||||
description: "Compositeur Wayland dynamique avec tiling automatique (utilisateurs avancés)."
|
||||
@@ -1,6 +1,10 @@
|
||||
---
|
||||
# Étape post-unpackfs : retire les paquets live-only.
|
||||
# Tous les paquets utiles sont déjà dans le squashfs.
|
||||
# Pas besoin d'installer quoi que ce soit depuis internet.
|
||||
|
||||
backend: pacman
|
||||
update_db: true
|
||||
update_db: false
|
||||
update_system: false
|
||||
|
||||
operations:
|
||||
|
||||
@@ -1,33 +1,21 @@
|
||||
---
|
||||
# dontChroot: true = exécuté dans le live system.
|
||||
# ${ROOT} → substitué par Calamares (GlobalStorage "rootMountPoint").
|
||||
# $(cat ...) → substitution bash pure, Calamares ne la touche PAS.
|
||||
# Exécuté HORS chroot (live system) pour accéder à l'ISO montée.
|
||||
# But : restaurer le kernel (retiré du squashfs par mkarchiso) et
|
||||
# corriger les fichiers mkinitcpio archiso-spécifiques.
|
||||
|
||||
dontChroot: true
|
||||
timeout: 7200
|
||||
|
||||
script:
|
||||
# Copie le kernel depuis l'ISO vers /boot du système cible
|
||||
- 'cp "$(find /run/archiso/bootmnt -name vmlinuz-linux 2>/dev/null | head -1)" "${ROOT}/boot/vmlinuz-linux"'
|
||||
- 'DESKTOP="$(cat /run/fws-desktop 2>/dev/null || printf xfce)"'
|
||||
- 'if [ -z "$DESKTOP" ]; then DESKTOP="xfce"; fi'
|
||||
- 'if [ ! -f "${ROOT}/usr/local/bin/fws-desktop-init-$DESKTOP" ]; then echo "Script bureau introuvable: $DESKTOP" >&2; exit 1; fi'
|
||||
- 'chroot "${ROOT}" /bin/bash "/usr/local/bin/fws-desktop-init-$DESKTOP"'
|
||||
|
||||
# DNS : copie le vrai fichier resolv.conf (résout le symlink cassé dans le chroot)
|
||||
- 'cp --remove-destination "$(readlink -f /etc/resolv.conf)" "${ROOT}/etc/resolv.conf"'
|
||||
|
||||
# Bypass temporaire du keyring pacman (vide dans le chroot fraîchement installé)
|
||||
# Empêche "error: keyring is not writable" lors du pacman -Sy dans le chroot.
|
||||
- 'sed -i "s/^SigLevel[[:space:]]*=.*/SigLevel = Never/" "${ROOT}/etc/pacman.conf" || true'
|
||||
|
||||
# Lance le script d'init du bureau choisi
|
||||
- 'chroot "${ROOT}" /bin/bash "/usr/local/bin/fws-desktop-init-$(cat /run/fws-desktop 2>/dev/null || echo xfce)"'
|
||||
|
||||
# Restaure SigLevel correct pour l'utilisateur final
|
||||
- 'sed -i "s/^SigLevel[[:space:]]*=.*/SigLevel = Required DatabaseOptional/" "${ROOT}/etc/pacman.conf" || true'
|
||||
|
||||
# Copie le keyring du live system → le système installé aura un keyring fonctionnel
|
||||
- 'mkdir -p "${ROOT}/etc/pacman.d/gnupg" && chmod 700 "${ROOT}/etc/pacman.d/gnupg" && cp -a /etc/pacman.d/gnupg/. "${ROOT}/etc/pacman.d/gnupg/"'
|
||||
|
||||
# Supprime le drop-in archiso (surcharge HOOKS inexistants post-install)
|
||||
# Supprime le drop-in archiso (surcharge HOOKS avec des hooks inexistants post-install)
|
||||
- 'rm -f "${ROOT}/etc/mkinitcpio.conf.d/archiso.conf"'
|
||||
|
||||
# Remplace le linux.preset archiso par le preset standard (default + fallback)
|
||||
# \x27 = ' et \x22 = " pour éviter les conflits de quotes dans YAML/bash
|
||||
- 'printf "PRESETS=(\x27default\x27 \x27fallback\x27)\nALL_kver=\x22/boot/vmlinuz-linux\x22\nALL_config=\x22/etc/mkinitcpio.conf\x22\nALL_microcode=(/boot/*-ucode.img)\ndefault_image=\x22/boot/initramfs-linux.img\x22\nfallback_image=\x22/boot/initramfs-linux-fallback.img\x22\nfallback_options=\x22-S autodetect\x22\n" > "${ROOT}/etc/mkinitcpio.d/linux.preset"'
|
||||
|
||||
@@ -12,7 +12,7 @@ sequence:
|
||||
- keyboard
|
||||
- partition
|
||||
- users
|
||||
- packagechooser
|
||||
- desktop
|
||||
- summary
|
||||
- exec:
|
||||
- partition
|
||||
@@ -27,7 +27,6 @@ sequence:
|
||||
- hwclock
|
||||
- networkcfg
|
||||
- packages
|
||||
- fws-desktop-choice
|
||||
- shellprocess
|
||||
- initcpiocfg
|
||||
- initcpio
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
[Unit]
|
||||
Description=FWS Installer (Calamares)
|
||||
After=graphical.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/calamares
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical.target
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Sélection de l'environnement de bureau AVANT le démarrage de Calamares.
|
||||
# Les services systemd n'héritent pas de $DISPLAY — on force :0 (session Xorg live).
|
||||
|
||||
export DISPLAY=":0"
|
||||
|
||||
DESKTOP="xfce" # valeur par défaut si zenity échoue
|
||||
|
||||
CHOICE=$(zenity \
|
||||
--list \
|
||||
--title="FWS — Environnement de bureau" \
|
||||
--text="Quel environnement de bureau souhaitez-vous installer ?" \
|
||||
--column="Environnement" \
|
||||
--column="Description" \
|
||||
--width=580 \
|
||||
--height=340 \
|
||||
"Xfce (Recommandé)" "Léger et rapide — idéal pour tous les systèmes" \
|
||||
"KDE Plasma" "Moderne, riche en fonctionnalités et personnalisable" \
|
||||
"GNOME" "Interface épurée centrée sur la productivité" \
|
||||
"Hyprland" "Compositeur Wayland dynamique (utilisateurs avancés)" \
|
||||
2>/dev/null) || true
|
||||
|
||||
case "${CHOICE:-}" in
|
||||
"Xfce (Recommandé)") DESKTOP="xfce" ;;
|
||||
"KDE Plasma") DESKTOP="kde" ;;
|
||||
"GNOME") DESKTOP="gnome" ;;
|
||||
"Hyprland") DESKTOP="hyprland" ;;
|
||||
*) DESKTOP="xfce" ;;
|
||||
esac
|
||||
|
||||
printf '%s' "$DESKTOP" > /run/fws-desktop
|
||||
|
||||
exec /usr/bin/calamares "$@"
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
. /usr/local/bin/fws-desktop-init-common
|
||||
|
||||
# Mode CLI : pas d'interface graphique.
|
||||
# On installe uniquement les outils serveur + WinBoat + Wine.
|
||||
fws_install_packages mariadb mariadb-clients wine \
|
||||
qemu-base podman podman-compose git
|
||||
|
||||
mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql \
|
||||
>/dev/null 2>&1 || true
|
||||
fws_enable_services mariadb.service podman.socket
|
||||
|
||||
printf 'kvm\nkvm_intel\nkvm_amd\n' > /etc/modules-load.d/kvm.conf
|
||||
|
||||
fws_disable_services lightdm.service sddm.service gdm.service
|
||||
@@ -1,80 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
fws_first_user() {
|
||||
awk -F: '$3 >= 1000 && $1 != "nobody" { print $1; exit }' /etc/passwd
|
||||
}
|
||||
|
||||
fws_install_packages() {
|
||||
pacman -Sy --noconfirm --needed "$@"
|
||||
}
|
||||
|
||||
fws_enable_services() {
|
||||
for service in "$@"; do
|
||||
systemctl enable "$service" >/dev/null 2>&1 || true
|
||||
done
|
||||
}
|
||||
|
||||
fws_disable_services() {
|
||||
for service in "$@"; do
|
||||
systemctl disable "$service" >/dev/null 2>&1 || true
|
||||
done
|
||||
}
|
||||
|
||||
# Retire Xfce + LightDM présents dans le squashfs du live system.
|
||||
# Appelé par les scripts KDE / GNOME / Hyprland pour ne pas laisser
|
||||
# les sessions Xfce apparaître dans le sélecteur du DM.
|
||||
fws_remove_xfce() {
|
||||
pacman -Rns --noconfirm xfce4 xfce4-goodies \
|
||||
lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings \
|
||||
2>/dev/null || true
|
||||
}
|
||||
|
||||
fws_write_dmrc() {
|
||||
local user_name="$1"
|
||||
local session_name="$2"
|
||||
|
||||
if [ -n "$user_name" ] && [ -d "/home/$user_name" ]; then
|
||||
printf '[Desktop]\nSession=%s\n' "$session_name" > "/home/$user_name/.dmrc"
|
||||
fi
|
||||
}
|
||||
|
||||
# Configure SDDM : session par défaut uniquement, PAS d'autologin.
|
||||
# L'utilisateur devra entrer son mot de passe à chaque démarrage.
|
||||
fws_write_sddm_config() {
|
||||
local session_name="$1"
|
||||
|
||||
mkdir -p /etc/sddm.conf.d
|
||||
printf '[General]\nDefaultSession=%s.desktop\n\n[Theme]\nCurrent=\n' \
|
||||
"$session_name" \
|
||||
> /etc/sddm.conf.d/50-fws.conf
|
||||
}
|
||||
|
||||
# Configure LightDM : session par défaut uniquement, PAS d'autologin.
|
||||
fws_write_lightdm_config() {
|
||||
local session_name="$1"
|
||||
|
||||
mkdir -p /etc/lightdm/lightdm.conf.d
|
||||
printf '[Seat:*]\nuser-session=%s\nallow-guest=false\n' \
|
||||
"$session_name" \
|
||||
> /etc/lightdm/lightdm.conf.d/50-fws.conf
|
||||
}
|
||||
|
||||
# Paquets installés par défaut sur tous les bureaux
|
||||
fws_install_base_apps() {
|
||||
fws_install_packages firefox libreoffice-fresh mariadb mariadb-clients wine
|
||||
|
||||
# MariaDB
|
||||
mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql \
|
||||
>/dev/null 2>&1 || true
|
||||
fws_enable_services mariadb.service
|
||||
|
||||
# Dépendances WinBoat : KVM, Podman, Podman Compose
|
||||
fws_install_packages qemu-base podman podman-compose
|
||||
|
||||
# Charge les modules KVM au démarrage
|
||||
printf 'kvm\nkvm_intel\nkvm_amd\n' > /etc/modules-load.d/kvm.conf
|
||||
|
||||
# Active le socket Podman pour l'utilisateur root
|
||||
fws_enable_services podman.socket
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
. /usr/local/bin/fws-desktop-init-common
|
||||
|
||||
first_user="$(fws_first_user)"
|
||||
|
||||
fws_remove_xfce
|
||||
fws_install_base_apps
|
||||
fws_install_packages gnome gdm
|
||||
fws_disable_services lightdm.service sddm.service
|
||||
fws_enable_services gdm.service
|
||||
fws_write_dmrc "$first_user" gnome
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
. /usr/local/bin/fws-desktop-init-common
|
||||
|
||||
first_user="$(fws_first_user)"
|
||||
|
||||
fws_remove_xfce
|
||||
fws_install_base_apps
|
||||
fws_install_packages hyprland xdg-desktop-portal-hyprland xdg-desktop-portal-gtk \
|
||||
waybar wofi kitty swaybg swayidle swaylock xorg-xwayland wl-clipboard \
|
||||
grim slurp qt5-wayland qt6-wayland sddm
|
||||
fws_disable_services lightdm.service gdm.service
|
||||
fws_enable_services sddm.service
|
||||
fws_write_sddm_config hyprland
|
||||
fws_write_dmrc "$first_user" hyprland
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
. /usr/local/bin/fws-desktop-init-common
|
||||
|
||||
first_user="$(fws_first_user)"
|
||||
|
||||
fws_remove_xfce
|
||||
fws_install_base_apps
|
||||
fws_install_packages plasma-meta konsole dolphin sddm
|
||||
fws_disable_services lightdm.service gdm.service
|
||||
fws_enable_services sddm.service
|
||||
fws_write_sddm_config plasma
|
||||
fws_write_dmrc "$first_user" plasma
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
. /usr/local/bin/fws-desktop-init-common
|
||||
|
||||
first_user="$(fws_first_user)"
|
||||
|
||||
# Xfce est déjà dans le squashfs — on s'assure juste qu'il est complet
|
||||
fws_install_base_apps
|
||||
fws_install_packages xfce4 xfce4-goodies lightdm lightdm-gtk-greeter
|
||||
fws_disable_services sddm.service gdm.service
|
||||
fws_enable_services lightdm.service
|
||||
fws_write_lightdm_config xfce
|
||||
fws_write_dmrc "$first_user" xfce
|
||||
Reference in New Issue
Block a user