feat(Installer): Add Multi Desktop environnement in the installer to allow the user to choose wich desktop env
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#!/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 "$@"
|
||||
@@ -0,0 +1,68 @@
|
||||
#!/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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
fws_write_lightdm_config() {
|
||||
local user_name="$1"
|
||||
local session_name="$2"
|
||||
|
||||
if [ -z "$user_name" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
mkdir -p /etc/lightdm/lightdm.conf.d
|
||||
printf '[Seat:*]\nautologin-user=%s\nautologin-user-timeout=0\nuser-session=%s\nautologin-session=%s\ngreeter-hide-users=true\nallow-guest=false\n' \
|
||||
"$user_name" "$session_name" "$session_name" \
|
||||
> /etc/lightdm/lightdm.conf.d/50-fws.conf
|
||||
}
|
||||
|
||||
fws_write_sddm_config() {
|
||||
local user_name="$1"
|
||||
local session_name="$2"
|
||||
|
||||
if [ -z "$user_name" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
mkdir -p /etc/sddm.conf.d
|
||||
printf '[Autologin]\nUser=%s\nSession=%s.desktop\nRelogin=false\n' \
|
||||
"$user_name" "$session_name" \
|
||||
> /etc/sddm.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
|
||||
# Initialise la base de données MariaDB
|
||||
mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql \
|
||||
>/dev/null 2>&1 || true
|
||||
fws_enable_services mariadb.service
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
. /usr/local/bin/fws-desktop-init-common
|
||||
|
||||
first_user="$(fws_first_user)"
|
||||
|
||||
fws_install_base_apps
|
||||
fws_install_packages gnome sddm
|
||||
fws_disable_services lightdm.service gdm.service
|
||||
fws_enable_services sddm.service
|
||||
fws_write_sddm_config "$first_user" gnome
|
||||
fws_write_dmrc "$first_user" gnome
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
. /usr/local/bin/fws-desktop-init-common
|
||||
|
||||
first_user="$(fws_first_user)"
|
||||
|
||||
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 "$first_user" hyprland
|
||||
fws_write_dmrc "$first_user" hyprland
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
. /usr/local/bin/fws-desktop-init-common
|
||||
|
||||
first_user="$(fws_first_user)"
|
||||
|
||||
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 "$first_user" plasma
|
||||
fws_write_dmrc "$first_user" plasma
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
. /usr/local/bin/fws-desktop-init-common
|
||||
|
||||
first_user="$(fws_first_user)"
|
||||
|
||||
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 "$first_user" xfce
|
||||
fws_write_dmrc "$first_user" xfce
|
||||
Reference in New Issue
Block a user