forked from Shinonome/caelestia-cli
changed foot to kitty
This commit is contained in:
@@ -23,7 +23,10 @@ class Command:
|
|||||||
def move_client(self, selector: callable, workspace: str) -> None:
|
def move_client(self, selector: callable, workspace: str) -> None:
|
||||||
for client in self.get_clients():
|
for client in self.get_clients():
|
||||||
if selector(client):
|
if selector(client):
|
||||||
hypr.dispatch("movetoworkspacesilent", f"special:{workspace},address:{client['address']}")
|
hypr.dispatch(
|
||||||
|
"movetoworkspacesilent",
|
||||||
|
f"special:{workspace},address:{client['address']}",
|
||||||
|
)
|
||||||
|
|
||||||
def spawn_client(self, selector: callable, spawn: list[str]) -> bool:
|
def spawn_client(self, selector: callable, spawn: list[str]) -> bool:
|
||||||
exists = any(selector(client) for client in self.get_clients())
|
exists = any(selector(client) for client in self.get_clients())
|
||||||
@@ -33,18 +36,24 @@ class Command:
|
|||||||
|
|
||||||
return not exists
|
return not exists
|
||||||
|
|
||||||
def spawn_or_move(self, selector: callable, spawn: list[str], workspace: str) -> None:
|
def spawn_or_move(
|
||||||
|
self, selector: callable, spawn: list[str], workspace: str
|
||||||
|
) -> None:
|
||||||
if not self.spawn_client(selector, spawn):
|
if not self.spawn_client(selector, spawn):
|
||||||
self.move_client(selector, workspace)
|
self.move_client(selector, workspace)
|
||||||
|
|
||||||
def communication(self) -> None:
|
def communication(self) -> None:
|
||||||
self.spawn_or_move(lambda c: c["class"] == "discord", ["discord"], "communication")
|
self.spawn_or_move(
|
||||||
|
lambda c: c["class"] == "discord", ["discord"], "communication"
|
||||||
|
)
|
||||||
self.move_client(lambda c: c["class"] == "whatsapp", "communication")
|
self.move_client(lambda c: c["class"] == "whatsapp", "communication")
|
||||||
hypr.dispatch("togglespecialworkspace", "communication")
|
hypr.dispatch("togglespecialworkspace", "communication")
|
||||||
|
|
||||||
def music(self) -> None:
|
def music(self) -> None:
|
||||||
self.spawn_or_move(
|
self.spawn_or_move(
|
||||||
lambda c: c["class"] == "Spotify" or c["initialTitle"] == "Spotify" or c["initialTitle"] == "Spotify Free",
|
lambda c: c["class"] == "Spotify"
|
||||||
|
or c["initialTitle"] == "Spotify"
|
||||||
|
or c["initialTitle"] == "Spotify Free",
|
||||||
["spicetify", "watch", "-s"],
|
["spicetify", "watch", "-s"],
|
||||||
"music",
|
"music",
|
||||||
)
|
)
|
||||||
@@ -53,8 +62,11 @@ class Command:
|
|||||||
|
|
||||||
def sysmon(self) -> None:
|
def sysmon(self) -> None:
|
||||||
self.spawn_client(
|
self.spawn_client(
|
||||||
lambda c: c["class"] == "btop" and c["title"] == "btop" and c["workspace"]["name"] == "special:sysmon",
|
lambda c: c["class"] == "btop"
|
||||||
["foot", "-a", "btop", "-T", "btop", "fish", "-C", "exec btop"],
|
and c["title"] == "btop"
|
||||||
|
and c["workspace"]["name"] == "special:sysmon",
|
||||||
|
# ["foot", "-a", "btop", "-T", "btop", "fish", "-C", "exec btop"],
|
||||||
|
["kitty", "-T", "btop", "fish", "-c", "btop"],
|
||||||
)
|
)
|
||||||
hypr.dispatch("togglespecialworkspace", "sysmon")
|
hypr.dispatch("togglespecialworkspace", "sysmon")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user