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.
|
# aucune dépendance supplémentaire.
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
_STYLE = "/usr/local/share/fws/wofi-keys.css"
|
||||||
|
|
||||||
# Bits de modmask (masques X11) dans l'ordre d'affichage voulu.
|
# Bits de modmask (masques X11) dans l'ordre d'affichage voulu.
|
||||||
_MODS = [
|
_MODS = [
|
||||||
(64, "SUPER"),
|
(64, "SUPER"),
|
||||||
@@ -84,10 +87,13 @@ def main():
|
|||||||
lines = ["(aucun raccourci déclaré)"]
|
lines = ["(aucun raccourci déclaré)"]
|
||||||
|
|
||||||
# dmenu = liste + filtre incrémental ; la sélection n'a pas d'effet.
|
# dmenu = liste + filtre incrémental ; la sélection n'a pas d'effet.
|
||||||
subprocess.run(
|
cmd = ["wofi", "--dmenu", "--prompt", "Raccourcis clavier — taper pour filtrer",
|
||||||
["wofi", "--dmenu", "--prompt", "Raccourcis clavier — taper pour filtrer",
|
"--width", "820", "--height", "600", "--insensitive",
|
||||||
"--width", "780", "--height", "560", "--insensitive", "--cache-file", "/dev/null"],
|
"--cache-file", "/dev/null"]
|
||||||
input="\n".join(lines), text=True, check=False)
|
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
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user