diff --git a/system/usr/local/bin/fws-powermenu b/system/usr/local/bin/fws-powermenu index 4002796..c63178e 100755 --- a/system/usr/local/bin/fws-powermenu +++ b/system/usr/local/bin/fws-powermenu @@ -9,7 +9,14 @@ import os import subprocess import sys -_WOFI_STYLE = "/usr/local/share/fws/wofi-style.css" +# Style passé à wofi, par ordre de préférence : d'abord le style violet +# installé par le thème dans le profil utilisateur (Super+X — alimentation — +# et Super+R — applications — partagent ainsi le même look), sinon le style +# système FWS s'il est présent. +_WOFI_STYLE_CANDIDATES = ( + os.path.expanduser("~/.config/wofi/style.css"), + "/usr/local/share/fws/wofi-style.css", +) _HYPR = bool(os.environ.get("HYPRLAND_INSTANCE_SIGNATURE")) # (libellé affiché, commande shell). L'icône Nerd Font aide au repérage. @@ -34,8 +41,10 @@ def _menu(entries): if _HYPR: cmd = ["wofi", "--dmenu", "--prompt", "Alimentation", "--width", "300", "--height", "260", "--cache-file", "/dev/null"] - if os.path.exists(_WOFI_STYLE): - cmd += ["--style", _WOFI_STYLE] + style = next((s for s in _WOFI_STYLE_CANDIDATES + if os.path.exists(s)), None) + if style: + cmd += ["--style", style] else: cmd = ["rofi", "-dmenu", "-i", "-p", "Alimentation", "-no-custom", "-theme-str", "window { width: 300px; } listview { lines: 5; }"]