feat: multi environnemnt desktop
[180][WIP]
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import calamares 1.0
|
||||
|
||||
Page {
|
||||
id: page
|
||||
title: qsTr("Choix de l'environnement")
|
||||
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 20
|
||||
spacing: 12
|
||||
|
||||
Text {
|
||||
text: qsTr("Choisissez l'environnement de bureau à installer :")
|
||||
font.pixelSize: 20
|
||||
color: "#00d4ff"
|
||||
}
|
||||
|
||||
RadioButton { id: rb_xfce; text: "Xfce"; checked: true; onCheckedChanged: if (checked) saveChoice() }
|
||||
RadioButton { id: rb_kde; text: "KDE"; onCheckedChanged: if (checked) saveChoice() }
|
||||
RadioButton { id: rb_gnome; text: "GNOME"; onCheckedChanged: if (checked) saveChoice() }
|
||||
RadioButton { id: rb_hypr; text: "Hyprland"; onCheckedChanged: if (checked) saveChoice() }
|
||||
|
||||
Button {
|
||||
text: qsTr("Enregistrer le choix")
|
||||
onClicked: saveChoice()
|
||||
}
|
||||
|
||||
function saveChoice() {
|
||||
var choice = rb_xfce.checked ? "xfce" : (rb_kde.checked ? "kde" : (rb_gnome.checked ? "gnome" : "hyprland"))
|
||||
try {
|
||||
calamares.globalStorage.insert("FWS_DESKTOP", choice)
|
||||
} catch (e) {
|
||||
// ignore if unavailable
|
||||
}
|
||||
try {
|
||||
calamares.utils.runCommand("/bin/sh", ["-c", "printf '%s' \"" + choice + "\" > /run/fws-desktop"], true)
|
||||
} catch (e) {
|
||||
// best effort
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
# 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"
|
||||
@@ -12,10 +12,6 @@ units:
|
||||
action: "enable"
|
||||
mandatory: false
|
||||
|
||||
- name: "lightdm.service"
|
||||
action: "enable"
|
||||
mandatory: true
|
||||
|
||||
- name: "sshd.service"
|
||||
action: "enable"
|
||||
mandatory: false
|
||||
|
||||
@@ -8,14 +8,13 @@ dontChroot: true
|
||||
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"'
|
||||
|
||||
# Configure LightDM pour démarrer automatiquement la session XFCE du premier utilisateur créé.
|
||||
- 'FIRST_USER="$(awk -F: ''$$3 >= 1000 && $$1 != "nobody" { print $$1; exit }'' "${ROOT}/etc/passwd")"'
|
||||
- 'if [ -n "$$FIRST_USER" ]; then mkdir -p "${ROOT}/etc/lightdm/lightdm.conf.d"; printf ''[Seat:*]\nautologin-user=%s\nautologin-user-timeout=0\nuser-session=xfce\nautologin-session=xfce\ngreeter-hide-users=true\nallow-guest=false\n'' "$$FIRST_USER" > "${ROOT}/etc/lightdm/lightdm.conf.d/50-fws.conf"; fi'
|
||||
- 'if [ -n "$$FIRST_USER" ] && [ -d "${ROOT}/home/$$FIRST_USER" ]; then printf ''[Desktop]\nSession=xfce\n'' > "${ROOT}/home/$$FIRST_USER/.dmrc"; fi'
|
||||
- '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"'
|
||||
|
||||
# Supprime le drop-in archiso (surcharge HOOKS avec des hooks inexistants post-install)
|
||||
- '-rm -f "${ROOT}/etc/mkinitcpio.conf.d/archiso.conf"'
|
||||
- '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
|
||||
|
||||
@@ -12,6 +12,7 @@ sequence:
|
||||
- keyboard
|
||||
- partition
|
||||
- users
|
||||
- desktop
|
||||
- summary
|
||||
- exec:
|
||||
- partition
|
||||
|
||||
@@ -61,6 +61,7 @@ wget
|
||||
zsh
|
||||
grml-zsh-config
|
||||
bash
|
||||
zenity
|
||||
nano
|
||||
vim
|
||||
less
|
||||
|
||||
Reference in New Issue
Block a user