summaryrefslogtreecommitdiff
path: root/src/caelestia/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/caelestia/utils')
-rw-r--r--src/caelestia/utils/hypr.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/caelestia/utils/hypr.py b/src/caelestia/utils/hypr.py
index f89cd98..81bc123 100644
--- a/src/caelestia/utils/hypr.py
+++ b/src/caelestia/utils/hypr.py
@@ -27,3 +27,9 @@ def message(msg: str, json: bool = True) -> str | dict[str, any]:
def dispatch(dispatcher: str, *args: list[any]) -> bool:
return message(f"dispatch {dispatcher} {' '.join(map(str, args))}".rstrip(), json=False) == "ok"
+
+
+def batch(*msgs: list[str], json: bool = False) -> str | dict[str, any]:
+ if json:
+ msgs = (f"j/{m.strip()}" for m in msgs)
+ return message(f"[[BATCH]]{';'.join(msgs)}", json=False)