fix(waybar/power-profile): masquer le module sur PC sans ACPI platform_profile
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.
This commit is contained in:
@@ -40,6 +40,12 @@ fi
|
|||||||
|
|
||||||
# ── Affichage JSON ────────────────────────────────────────────────────────────
|
# ── 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")
|
PROFILE=$(cat /sys/firmware/acpi/platform_profile 2>/dev/null || echo "unknown")
|
||||||
|
|
||||||
case "$PROFILE" in
|
case "$PROFILE" in
|
||||||
|
|||||||
Reference in New Issue
Block a user