diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-13 00:42:46 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-13 00:42:46 +1000 |
| commit | 796d538b168855ebd2afd62278800151816adcab (patch) | |
| tree | 27a29d9a44b8a7a6e68973d84895055a8aa37c9a /src/caelestia/subcommands/toggle.py | |
| parent | scheme: ensure enough colours (diff) | |
| download | caelestia-cli-796d538b168855ebd2afd62278800151816adcab.tar.gz caelestia-cli-796d538b168855ebd2afd62278800151816adcab.tar.bz2 caelestia-cli-796d538b168855ebd2afd62278800151816adcab.zip | |
feat: impl screenshot command
Diffstat (limited to 'src/caelestia/subcommands/toggle.py')
| -rw-r--r-- | src/caelestia/subcommands/toggle.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/caelestia/subcommands/toggle.py b/src/caelestia/subcommands/toggle.py index fd49c30..b8ad11b 100644 --- a/src/caelestia/subcommands/toggle.py +++ b/src/caelestia/subcommands/toggle.py @@ -1,3 +1,4 @@ +import subprocess from argparse import Namespace from caelestia.utils import hypr @@ -6,7 +7,6 @@ from caelestia.utils import hypr class Command: args: Namespace clients: list[dict[str, any]] = None - app2unit: str = None def __init__(self, args: Namespace) -> None: self.args = args @@ -20,14 +20,6 @@ class Command: return self.clients - def get_app2unit(self) -> str: - if self.app2unit is None: - import shutil - - self.app2unit = shutil.which("app2unit") - - return self.app2unit - def move_client(self, selector: callable, workspace: str) -> None: for client in self.get_clients(): if selector(client): @@ -37,9 +29,7 @@ class Command: exists = any(selector(client) for client in self.get_clients()) if not exists: - import subprocess - - subprocess.Popen([self.get_app2unit(), "--", *spawn], start_new_session=True) + subprocess.Popen(["app2unit", "--", *spawn], start_new_session=True) return not exists |