From d6212deaa95e08306b7cd8b06e7eb4a8f2efa8d2 Mon Sep 17 00:00:00 2001 From: nocode Date: Sat, 4 Jul 2026 00:25:45 +0200 Subject: [PATCH] feat(fws-hypr-keys): add optional style support and adjust wofi dimensions - Import os module to check for style file existence - Add _STYLE constant pointing to wofi-keys.css stylesheet - Increase wofi window dimensions from 780x560 to 820x600 - Conditionally apply custom style if the stylesheet exists - Refactor wofi command construction for better readability --- .../releng/airootfs/usr/local/bin/fws-hypr-keys | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/configs/releng/airootfs/usr/local/bin/fws-hypr-keys b/configs/releng/airootfs/usr/local/bin/fws-hypr-keys index e8c5453..9580d94 100755 --- a/configs/releng/airootfs/usr/local/bin/fws-hypr-keys +++ b/configs/releng/airootfs/usr/local/bin/fws-hypr-keys @@ -12,9 +12,12 @@ # aucune dépendance supplémentaire. import json +import os import subprocess import sys +_STYLE = "/usr/local/share/fws/wofi-keys.css" + # Bits de modmask (masques X11) dans l'ordre d'affichage voulu. _MODS = [ (64, "SUPER"), @@ -84,10 +87,13 @@ def main(): lines = ["(aucun raccourci déclaré)"] # dmenu = liste + filtre incrémental ; la sélection n'a pas d'effet. - subprocess.run( - ["wofi", "--dmenu", "--prompt", "Raccourcis clavier — taper pour filtrer", - "--width", "780", "--height", "560", "--insensitive", "--cache-file", "/dev/null"], - input="\n".join(lines), text=True, check=False) + cmd = ["wofi", "--dmenu", "--prompt", "Raccourcis clavier — taper pour filtrer", + "--width", "820", "--height", "600", "--insensitive", + "--cache-file", "/dev/null"] + if os.path.exists(_STYLE): + # Style dédié : monospace (colonnes alignées) + palette FWS. + cmd += ["--style", _STYLE] + subprocess.run(cmd, input="\n".join(lines), text=True, check=False) return 0