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
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user