diff options
Diffstat (limited to 'deckit')
| -rw-r--r-- | deckit/config.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/deckit/config.py b/deckit/config.py index e20bc00..6ce0cba 100644 --- a/deckit/config.py +++ b/deckit/config.py @@ -26,6 +26,8 @@ ROOT = Path(__file__).resolve().parent.parent MONITOR_NAME = re.compile(r"[A-Za-z0-9_-]{1,32}") WIFI_ADDR = re.compile(r"[A-Za-z0-9.-]{1,253}:[0-9]{1,5}") DESKTOP_ID = re.compile(r"[A-Za-z0-9._-]{1,255}") +# The dashboard's action buttons; deckit/modules/actions.py maps each to its command. +ACTION_IDS = ("screenshot", "lock") def user_config_path() -> Path: @@ -54,6 +56,9 @@ def config_error(cfg: dict) -> str | None: apps = cfg.get("launch", {}).get("apps", []) if not isinstance(apps, list) or not all(isinstance(a, str) and DESKTOP_ID.fullmatch(a) for a in apps): return "launch.apps must be a list of desktop ids, like \"kitty\"" + acts = cfg.get("dashboard", {}).get("actions", []) + if not isinstance(acts, list) or not all(a in ACTION_IDS for a in acts): + return f"dashboard.actions must be a list of: {', '.join(ACTION_IDS)}" return None |
