diff options
Diffstat (limited to 'modules/intents')
-rw-r--r-- | modules/intents/__init__.py | 4 | ||||
-rw-r--r-- | modules/intents/process.py | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/modules/intents/__init__.py b/modules/intents/__init__.py new file mode 100644 index 0000000..1cb91d4 --- /dev/null +++ b/modules/intents/__init__.py @@ -0,0 +1,4 @@ +from os.path import dirname, basename, isfile, join +import glob +modules = glob.glob(join(dirname(__file__), "*.py")) +__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
\ No newline at end of file diff --git a/modules/intents/process.py b/modules/intents/process.py new file mode 100644 index 0000000..4b3fdab --- /dev/null +++ b/modules/intents/process.py @@ -0,0 +1,12 @@ +import os +from typing import Dict + + +def switch_to_workspace(data: Dict): + os.popen(f"swaymsg workspace {data["workspace"]}") + +def HesExecuteProcess(data: Dict): + if "workspace" in data: + switch_to_workspace(data) + + os.popen(data["process"].strip()) |