summaryrefslogtreecommitdiff
path: root/src/caelestia/subcommands/wsaction.py
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-11 00:41:05 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-11 00:41:05 +1000
commitf663e6f6908a9dfb05ac22e867e726c1bf6f0960 (patch)
tree4e9a8eaf275a2e145c6384964cdc5f351b49b924 /src/caelestia/subcommands/wsaction.py
parentfeat: impl workspace-action command (diff)
downloadcaelestia-cli-f663e6f6908a9dfb05ac22e867e726c1bf6f0960.tar.gz
caelestia-cli-f663e6f6908a9dfb05ac22e867e726c1bf6f0960.tar.bz2
caelestia-cli-f663e6f6908a9dfb05ac22e867e726c1bf6f0960.zip
internal: refactor for packaging
Package using python-build, python-installer and hatch
Diffstat (limited to 'src/caelestia/subcommands/wsaction.py')
-rw-r--r--src/caelestia/subcommands/wsaction.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/caelestia/subcommands/wsaction.py b/src/caelestia/subcommands/wsaction.py
new file mode 100644
index 0000000..d496381
--- /dev/null
+++ b/src/caelestia/subcommands/wsaction.py
@@ -0,0 +1,18 @@
+from argparse import Namespace
+
+from caelestia.utils import hypr
+
+
+class Command:
+ args: Namespace
+
+ def __init__(self, args: Namespace) -> None:
+ self.args = args
+
+ def run(self) -> None:
+ active_ws = hypr.message("activeworkspace")["id"]
+
+ if self.args.group:
+ hypr.dispatch(self.args.dispatcher, (self.args.workspace - 1) * 10 + active_ws % 10)
+ else:
+ hypr.dispatch(self.args.dispatcher, int((active_ws - 1) / 10) * 10 + self.args.workspace)