summaryrefslogtreecommitdiff
path: root/src/caelestia/subcommands/wsaction.py
blob: d4963818a615286f19d2b3c1645cb105a9915cf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)