fix(hyprland): ship the desktop config as hyprland.lua

Hyprland 0.57 dropped the hyprlang syntax, so hyprland.conf is no longer
read and the session started bare with a US layout. The template now
emits the Lua config that Anaconda renders into /etc/skel and the homes
it just created.
This commit is contained in:
BlackAngelTV committed 2026-11-26 21:33:00 +01:00
1 parent e2634dca71
commit ea3cd5a28d
4 files changed
+209 -201

No files matched your search

@@ -566,6 +566,9 @@ print("XV=" + shlex.quote(",".join(variant for _, variant in pairs)))
print("XO=" + shlex.quote(",".join(options)))
KBPY
)"
# Two layouts without variants give XV="," — XKB then has no usable variant
# list, so "no variant" stays empty.
[ -n "${XV//,/}" ] || XV=""
if [ -n "$XL" ]; then
install -d /etc/X11/xorg.conf.d
{
@@ -892,16 +895,19 @@ done
# --- Config Hyprland (si choisi) : clavier + apps + waybar -------------------
# Hyprland (Wayland) NE lit PAS /etc/X11/xorg.conf.d/00-keyboard.conf : sa
# disposition est dans SA config (input { kb_layout }). Sans config il démarre nu
# (QWERTY US, aucune touche utile). On déploie une config FWS (template +
# (QWERTY US, aucune touche utile). On déploie la config FWS (template Lua +
# clavier XL/XV injecté) dans /etc/skel ET le home de chaque utilisateur déjà
# créé par Anaconda (le %post tourne APRÈS la création de l'utilisateur).
if [ "$DESK" = "hyprland" ] && [ -f /usr/local/share/fws/hyprland.conf.tmpl ]; then
if [ "$DESK" = "hyprland" ]; then
# Hyprland ≥ 0.57 ne lit plus hyprland.conf (syntaxe hyprlang supprimée) :
# seul hyprland.lua est chargé. Le template est rendu avec le clavier
# XL/XV/XO du choix Anaconda, puis posé dans le skel et chaque home.
sed -e "s/__KB_LAYOUT__/${XL:-us}/" -e "s/__KB_VARIANT__/${XV}/" -e "s/__KB_OPTIONS__/${XO}/" \
/usr/local/share/fws/hyprland.conf.tmpl > /tmp/fws-hyprland.conf
install -Dm644 /tmp/fws-hyprland.conf /etc/skel/.config/hypr/hyprland.conf
/usr/local/share/fws/hyprland.lua.tmpl > /tmp/fws-hyprland.lua
install -Dm644 /tmp/fws-hyprland.lua /etc/skel/.config/hypr/hyprland.lua
# Waybar FWS : barre assortie + bouton « ⌨ Raccourcis » (fws-keys,
# aussi sur SUPER+K) qui liste les binds RÉELS chargés par Hyprland
# (hyprctl binds -j) — les descriptions viennent des bindd de la config.
# (hyprctl binds -j) — les descriptions viennent des hl.bind de la config.
install -Dm644 /usr/local/share/fws/waybar-config.json /etc/skel/.config/waybar/config
install -Dm644 /usr/local/share/fws/waybar-style.css /etc/skel/.config/waybar/style.css
# wofi : style du menu d'applications (Super+R) — le panneau « Raccourcis »
@@ -910,7 +916,7 @@ if [ "$DESK" = "hyprland" ] && [ -f /usr/local/share/fws/hyprland.conf.tmpl ]; t
install -Dm644 /usr/local/share/fws/wofi-style.css /etc/skel/.config/wofi/style.css
while IFS=: read -r _u _x _uid _g _gec _home _sh; do
[ "$_uid" -ge 1000 ] && [ "$_uid" -le 60000 ] && [ -d "$_home" ] || continue
install -Dm644 /tmp/fws-hyprland.conf "$_home/.config/hypr/hyprland.conf"
install -Dm644 /tmp/fws-hyprland.lua "$_home/.config/hypr/hyprland.lua"
install -Dm644 /usr/local/share/fws/waybar-config.json "$_home/.config/waybar/config"
install -Dm644 /usr/local/share/fws/waybar-style.css "$_home/.config/waybar/style.css"
install -Dm644 /usr/local/share/fws/wofi-config "$_home/.config/wofi/config"
@@ -919,7 +925,7 @@ if [ "$DESK" = "hyprland" ] && [ -f /usr/local/share/fws/hyprland.conf.tmpl ]; t
chown -R "$_u": "$_home/.config/hypr" "$_home/.config/waybar" \
"$_home/.config/wofi" 2>/dev/null || true
done < /etc/passwd
rm -f /tmp/fws-hyprland.conf
rm -f /tmp/fws-hyprland.lua
fi
# --- Config i3 (si choisi) : raccourcis FWS + barre + autostart -------------