feat(installer): ship a default FWS wallpaper for fresh installs

New installs landed on a bare background (especially Hyprland and i3, which
declared no wallpaper at all), so the desktop did not look like FWS on first
boot. The image is bundled in the ISO instead of downloaded: it works without
network during the first boot, renders identically everywhere and needs no
hosting. A per-user marker stops the script once the wallpaper is set, so the
choice made afterwards by the user is never overwritten.
This commit is contained in:
BlackAngelTV committed 2026-10-29 19:07:14 +01:00
1 parent 5eb42c5ec3
commit 89a7cf23f3
9 files changed
+173 -2

No files matched your search

+2
View File
@@ -31,6 +31,7 @@ Le projet est conçu pour être **construit depuis Windows via WSL** (les script
| Commande | Rôle | Accès |
|---|---|---|
| `fws-hello` | Bienvenue au 1er démarrage (mise à jour, codecs, Proton-GE, VR, raccourcis) | auto au 1er login |
| `fws-wallpaper` | Fond d'écran FWS au **premier démarrage** — image embarquée dans l'ISO (aucun téléchargement) ; le choix fait ensuite par l'utilisateur n'est jamais écrasé (`--force` pour le reposer) | auto au 1er login, `fws-wallpaper --force` |
| `fws-update` | Mise à jour complète (pacman + cache + orphelins + flatpak) | bouton 󰚰 de la barre |
| `fws-keys` | Panneau des **raccourcis clavier réels** (lit la config Hyprland/i3) | `Super+K`, bouton ⌨ |
| `fws-powermenu` | Verrouiller / déconnexion / suspendre / redémarrer / éteindre | `Super+X`, bouton 󰐥 |
@@ -265,6 +266,7 @@ L'ISO finale est générée dans `./out/FWS-YYYY.MM.DD-x86_64.iso`.
- **Kickstart de l'installateur** : `configs/releng/airootfs/usr/share/anaconda/interactive-defaults.ks` (payload LiveOS via `--liveinst` + tout le `%post` : bureaux, drivers, pare-feu, branding)
- **Spokes Anaconda FWS** : `configs/baseline/airootfs/usr/lib/python3.14/site-packages/pyanaconda/ui/gui/spokes/` (`fws_desktop.py`, `fws_recap.py`, `fws_network.py` — écran « Connexion Internet » post-langue : sélecteur minimal Wi-Fi/Ethernet (plus l'UI complexe d'anaconda) + mot de passe, persistance du Wi-Fi via `%post --nochroot` ; glades dans `usr/share/anaconda/ui/spokes/` (`fws_network.glade`))
- **Configs bureaux & thèmes** : `configs/releng/airootfs/usr/local/share/fws/` (hyprland, i3, waybar, polybar, wofi, rofi, picom) et `usr/share/sddm/themes/fws/`
- **Fond d'écran par défaut** : `configs/releng/airootfs/usr/local/share/fws/wallpaper.png` (PNG 2560×1440, **embarqué dans l'ISO** — rien à télécharger au premier boot) appliqué par `usr/local/bin/fws-wallpaper` : autostart XDG (`etc/xdg/autostart/`) pour KDE/GNOME/XFCE, `swaybg` pour Hyprland et `feh` pour i3 (paquets ajoutés au `%post`)
- **Outils fws-\*** : `configs/releng/airootfs/usr/local/bin/`
- **GRUB du système installé (dualboot / bare-metal)** : `configs/releng/airootfs/etc/default/grub` (overlay : `GRUB_DISABLE_OS_PROBER=false` — sur Arch c'est `true` par défaut, d'où les « menus GRUB vides » sans Windows) ; `usr/local/bin/fws-grub-finalize` + `etc/systemd/system/fws-grub-finalize.service` (activé par le %post) : au 1er démarrage du système installé, réinstalle GRUB en `--removable` (chemin `EFI/BOOT/BOOTX64.EFI`, boote même si le firmware ASUS… oublie l'entrée NVRAM), crée/rafraîchit l'entrée NVRAM « FWS » (efibootmgr) et régénère le menu avec os-prober (Windows détecté)
- **Récupération sur l'OS installé** : entrée GRUB générée par `configs/releng/airootfs/etc/grub.d/42_fws-recovery` → `fws-recovery.target` + `fws-recovery-boot.service` (`etc/systemd/system/`) ; lanceur `usr/local/share/applications/fws-recovery.desktop` + politique polkit `usr/share/polkit-1/actions/org.fws.recovery.policy`
+1
View File
@@ -41,5 +41,6 @@ file_permissions=(
["/usr/local/bin/fws-recovery-gui"]="0:0:755"
["/usr/local/bin/fws-powermenu"]="0:0:755"
["/usr/local/bin/fws-about"]="0:0:755"
["/usr/local/bin/fws-wallpaper"]="0:0:755"
["/etc/grub.d/42_fws-recovery"]="0:0:755"
)
@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=Fond d'écran FWS
Comment=Applique le fond d'écran FWS au premier démarrage (le choix de l'utilisateur est conservé ensuite)
Exec=fws-wallpaper --autostart
Icon=preferences-desktop-wallpaper
Terminal=false
NoDisplay=true
Categories=System;
X-GNOME-Autostart-enabled=true
+150
View File
@@ -0,0 +1,150 @@
#!/bin/sh
# FWS — fond d'écran par défaut, posé au PREMIER démarrage graphique.
#
# L'image est EMBARQUÉE dans l'ISO (/usr/local/share/fws/wallpaper.png) au lieu
# d'être téléchargée : aucun réseau requis au premier boot, même rendu sur
# toutes les installations, et rien à héberger.
#
# Lancement :
# - /etc/xdg/autostart/fws-wallpaper.desktop (KDE, GNOME, XFCE) → « une fois » ;
# - Hyprland/i3 (pas d'autostart XDG) : la config de session appelle
# « fws-wallpaper --session » à chaque session — ces bureaux n'ont pas de
# réglage de fond persistant hors de leur config
# (swaybg respawné / feh repose le pixmap racine).
#
# Marqueur ~/.config/fws/wallpaper-done (même dossier que fws-hello) : une fois
# le fond posé, ce script ne touche PLUS à rien — le choix fait ensuite par
# l'utilisateur est conservé.
# fws-wallpaper --force réapplique le fond FWS par-dessus le choix actuel.
#
# Code retour : 0 = fond posé (ou déjà posé), 1 = rien à faire (session non
# reconnue, outil absent, sans affichage) — l'échec est volontairement silencieux,
# on ne casse jamais un démarrage de session pour un fond d'écran.
set -u
[ -n "${HOME:-}" ] || exit 1
WALL=/usr/local/share/fws/wallpaper.png
STATE_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/fws"
FLAG="$STATE_DIR/wallpaper-done"
MODE=once # once = ignore si déjà posé ; session = repose à chaque
# session (Hyprland/i3) ; force = réapplique maintenant
for _arg in "$@"; do
case "$_arg" in
--session) MODE=session ;;
--force) MODE=force ;;
--autostart) ;; # entrée /etc/xdg/autostart : comportement par défaut
-h|--help) awk 'NR > 1 { if ($0 !~ /^#/) exit; sub(/^# ?/, ""); print }' "$0"; exit 0 ;;
*) echo "Usage : fws-wallpaper [--force|--session]" >&2; exit 1 ;;
esac
done
[ -r "$WALL" ] || exit 1
# Pas de session graphique joignable (console, script lancé par un service) : rien à faire.
if [ -z "${DISPLAY:-}" ] && [ -z "${WAYLAND_DISPLAY:-}" ]; then
exit 1
fi
[ "$MODE" = "once" ] && [ -e "$FLAG" ] && exit 0
# --- Détection du bureau ----------------------------------------------------
# HYPRLAND_INSTANCE_SIGNATURE / I3SOCK sont les signatures FIABLES exportées aux
# processus de session (XDG_CURRENT_DESKTOP n'est pas garanti pour i3).
_lower() { printf '%s' "$1" | tr '[:upper:]' '[:lower:]'; }
DE=""
if [ -n "${HYPRLAND_INSTANCE_SIGNATURE:-}" ]; then
DE=hyprland
elif [ -n "${I3SOCK:-}" ]; then
DE=i3
else
case "$(_lower "${XDG_CURRENT_DESKTOP:-}")" in
*kde*|*plasma*) DE=kde ;;
*xfce*) DE=xfce ;;
*gnome*|*unity*) DE=gnome ;;
*i3*) DE=i3 ;;
esac
fi
[ -n "$DE" ] || exit 1
# --- KDE --------------------------------------------------------------------
# plasma-apply-wallpaperimage passe par plasmashell (DBus) : au tout premier
# login plasmashell peut ne pas être prêt → on réessaie ~20 s avant d'abandonner
# (sans marqueur, le prochain démarrage retentera).
_apply_kde() {
command -v plasma-apply-wallpaperimage >/dev/null 2>&1 || return 1
_i=0
while [ "$_i" -lt 10 ]; do
plasma-apply-wallpaperimage "$WALL" >/dev/null 2>&1 && return 0
_i=$((_i + 1))
sleep 2
done
return 1
}
# --- GNOME ------------------------------------------------------------------
_apply_gnome() {
command -v gsettings >/dev/null 2>&1 || return 1
gsettings set org.gnome.desktop.background picture-uri "file://$WALL" || return 1
# Thème sombre (GNOME ≥ 42) : GNOME lit picture-uri-dark dans ce cas.
gsettings set org.gnome.desktop.background picture-uri-dark "file://$WALL" 2>/dev/null || true
return 0
}
# --- XFCE ------------------------------------------------------------------
# xfce4-desktop stocke une propriété « last-image » par moniteur × espace de
# travail ; on remplit celles qui existent et, au tout premier login (propriétés
# pas encore créées), on les crée pour chaque sortie de xrandr (xfconf nomme les
# moniteurs par connecteur depuis XFCE 4.16 : monitorHDMI-1, monitoreDP-1…).
_apply_xfce() {
command -v xfconf-query >/dev/null 2>&1 || return 1
_done=0
for _p in $(xfconf-query -c xfce4-desktop -l 2>/dev/null | grep 'last-image$'); do
if xfconf-query -c xfce4-desktop -p "$_p" -s "$WALL" >/dev/null 2>&1; then
_done=1
# 5 = « zoom » (remplit l'écran sans déformer l'image).
xfconf-query -c xfce4-desktop -p "${_p%last-image}image-style" \
-n -t int -s 5 >/dev/null 2>&1 || true
fi
done
if [ "$_done" -eq 0 ] && command -v xrandr >/dev/null 2>&1; then
for _out in $(xrandr --listmonitors 2>/dev/null | awk 'NR>1 {print $4}' | sed 's#.*/##'); do
_base="/backdrop/screen0/monitor${_out}/workspace0"
xfconf-query -c xfce4-desktop -p "$_base/last-image" \
-n -t string -s "$WALL" >/dev/null 2>&1 && _done=1
xfconf-query -c xfce4-desktop -p "$_base/image-style" \
-n -t int -s 5 >/dev/null 2>&1 || true
done
fi
[ "$_done" -eq 1 ]
}
# --- Hyprland ---------------------------------------------------------------
# swaybg (layer-shell) affiche le fond ; setsid le détache du script, qui se
# termine tout de suite (sinon Hyprland attendrait un exec-once zombie).
_apply_hyprland() {
command -v swaybg >/dev/null 2>&1 || return 1
pkill -x swaybg >/dev/null 2>&1 || true
setsid swaybg -i "$WALL" -m fill >/dev/null 2>&1 &
return 0
}
# --- i3 --------------------------------------------------------------------
_apply_i3() {
command -v feh >/dev/null 2>&1 || return 1
feh --bg-fill "$WALL" >/dev/null 2>&1
}
case "$DE" in
kde) _apply_kde ;;
gnome) _apply_gnome ;;
xfce) _apply_xfce ;;
hyprland) _apply_hyprland ;;
i3) _apply_i3 ;;
*) exit 1 ;;
esac || exit 1
# Marqueur seulement hors « --session » : sur Hyprland/i3 le fond est reposé à
# chaque session par la config, le marqueur n'aurait aucun sens.
if [ "$MODE" != "session" ]; then
mkdir -p "$STATE_DIR" 2>/dev/null && : > "$FLAG" 2>/dev/null || true
fi
exit 0
@@ -65,6 +65,10 @@ misc {
# Démarrage de session : barre d'état, notifications, réseau dans le tray,
# agent d'authentification GUI (indispensable pour les apps qui demandent
# les droits admin : gestionnaire de disques, blueman…).
# Fond d'écran FWS : image EMBARQUÉE dans l'ISO (aucun réseau requis) — swaybg
# la repose à chaque session, Hyprland n'ayant pas de réglage de fond persistant
# hors config. « background_color » ci-dessus reste le repli si swaybg manque.
exec-once = fws-wallpaper --session
exec-once = waybar
exec-once = mako
exec-once = nm-applet
@@ -152,6 +152,9 @@ exec_always --no-startup-id sh -c 'pkill -x polybar; sleep 0.3; exec polybar -q
# rate le repaint des fenêtres GTK → contenus noirs/artefacts. Les coins
# arrondis sont sacrifiés en VM ; sur matériel réel picom se lance normalement.
exec --no-startup-id sh -c 'systemd-detect-virt --quiet || exec picom --config ~/.config/picom.conf'
# Fond d'écran FWS : image EMBARQUÉE dans l'ISO (aucun réseau requis) — feh
# repose le pixmap racine à chaque session (i3 n'a pas de fond persistant).
exec --no-startup-id fws-wallpaper --session
exec --no-startup-id dunst
exec --no-startup-id nm-applet
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

@@ -333,12 +333,12 @@ case "$DESK" in
# (fws-setup-hardware les re-propose ensuite en --needed : sans effet
# s'ils sont déjà là, filet de secours sinon).
xfce) PKGS="xfce4 xfce4-goodies sddm noto-fonts pipewire pipewire-pulse wireplumber pavucontrol"; DM="sddm" ;;
hyprland) PKGS="hyprland kitty wofi waybar sddm noto-fonts dolphin kio-extras udisks2 hyprlock grim slurp wl-clipboard playerctl mako libnotify polkit-gnome network-manager-applet xdg-desktop-portal-hyprland ttf-nerd-fonts-symbols pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;;
hyprland) PKGS="hyprland kitty wofi waybar swaybg sddm noto-fonts dolphin kio-extras udisks2 hyprlock grim slurp wl-clipboard playerctl mako libnotify polkit-gnome network-manager-applet xdg-desktop-portal-hyprland ttf-nerd-fonts-symbols pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;;
# i3 : session X11 → COMPATIBLE VR (SteamVR ne marche pas sous Wayland).
# xorg-server est requis (SDDM ne le tire pas) ; maim+xclip = captures X11,
# dunst = notifications X11 (équivalent de mako), i3lock = verrouillage.
# fws-vr-setup (Super+Shift+V ou menu) installe les drivers du casque.
i3) PKGS="i3-wm i3lock xorg-server polybar picom rofi kitty dolphin kio-extras udisks2 sddm noto-fonts ttf-nerd-fonts-symbols maim xclip dunst libnotify polkit-gnome network-manager-applet playerctl brightnessctl pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;;
i3) PKGS="i3-wm i3lock xorg-server polybar picom feh rofi kitty dolphin kio-extras udisks2 sddm noto-fonts ttf-nerd-fonts-symbols maim xclip dunst libnotify polkit-gnome network-manager-applet playerctl brightnessctl pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;;
cli|*) PKGS="" ;;
esac
# Navigateur de base ajouté DÈS QU'un bureau est choisi (jamais en CLI).
+1
View File
@@ -37,5 +37,6 @@ file_permissions=(
["/usr/local/bin/fws-recovery-gui"]="0:0:755"
["/usr/local/bin/fws-powermenu"]="0:0:755"
["/usr/local/bin/fws-about"]="0:0:755"
["/usr/local/bin/fws-wallpaper"]="0:0:755"
["/etc/grub.d/42_fws-recovery"]="0:0:755"
)