From 50f84afb66e022b9c22e95b83fdafe86a5889601 Mon Sep 17 00:00:00 2001 From: Tetardtek Date: Mon, 23 Feb 2026 22:16:47 +0100 Subject: [PATCH] fix(waybar/power-profile): masquer le module sur PC sans ACPI platform_profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Retourne un JSON avec text vide et class 'unavailable' si /sys/firmware/acpi/platform_profile est absent (PC fixe, VM), évitant l'affichage d'une erreur dans la barre. --- INSTALL/configs/waybar/scripts/power-profile.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/INSTALL/configs/waybar/scripts/power-profile.sh b/INSTALL/configs/waybar/scripts/power-profile.sh index 7de609d..3ccde8e 100755 --- a/INSTALL/configs/waybar/scripts/power-profile.sh +++ b/INSTALL/configs/waybar/scripts/power-profile.sh @@ -40,6 +40,12 @@ fi # ── Affichage JSON ──────────────────────────────────────────────────────────── +# PC fixe ou VM sans gestion de profil → module masqué +if [[ ! -f /sys/firmware/acpi/platform_profile ]]; then + printf '{"text":"","class":"unavailable"}\n' + exit 0 +fi + PROFILE=$(cat /sys/firmware/acpi/platform_profile 2>/dev/null || echo "unknown") case "$PROFILE" in