|
|
@@ -130,16 +130,16 @@ class BetterDisplay(CLIWrapper):
|
|
|
]
|
|
|
|
|
|
def __init__(self):
|
|
|
- if exists(self._base_args[0]) and self.execute(self._base_args + ["help"], timeout=0.5):
|
|
|
+ if exists(self._base_args[0]) and self.execute(
|
|
|
+ self._base_args + ["help"], timeout=0.5
|
|
|
+ ):
|
|
|
self._available = True
|
|
|
|
|
|
@property
|
|
|
def available(self) -> bool:
|
|
|
return self._available
|
|
|
|
|
|
- def set_brightness(
|
|
|
- self, display: BetterDisplayDisplay, value: float
|
|
|
- ):
|
|
|
+ def set_brightness(self, display: BetterDisplayDisplay, value: float):
|
|
|
self.message(
|
|
|
["set", f"-uuid={display.uuid}", "-feature=brightness", f"-value={value}"]
|
|
|
)
|
|
|
@@ -232,7 +232,6 @@ class Yabai(CLIWrapper):
|
|
|
if display:
|
|
|
better_display.set_brightness(display, 1)
|
|
|
|
|
|
-
|
|
|
def manage_spaces(self):
|
|
|
initial_window = self.get_focused_window()
|
|
|
# Start by making sure that the expected number of spaces are present
|
|
|
@@ -405,6 +404,17 @@ class Yabai(CLIWrapper):
|
|
|
f"action=/bin/zsh {XDG_CONFIG_HOME}/surfingkeys/compile.sh",
|
|
|
]
|
|
|
)
|
|
|
+ # Run Slack client script (populating cached values) when Slack is launched
|
|
|
+ self.message(
|
|
|
+ [
|
|
|
+ "signal",
|
|
|
+ "--add",
|
|
|
+ "event=application_launched",
|
|
|
+ "app=Slack",
|
|
|
+ "label=SlackRunSlackClientScript",
|
|
|
+ f"action=/usr/bin/env python3 {HOME}/.scripts/slack_client.py",
|
|
|
+ ]
|
|
|
+ )
|
|
|
# Check if dark mode settings have been updated when focusing terminal
|
|
|
self.message(
|
|
|
[
|
|
|
@@ -419,7 +429,11 @@ class Yabai(CLIWrapper):
|
|
|
|
|
|
def get_focused_window(self) -> Window | None:
|
|
|
windows = [
|
|
|
- window for window in [Window(window) for window in loads(self.message(["query", "--windows"]))] if window.has_focus
|
|
|
+ window
|
|
|
+ for window in [
|
|
|
+ Window(window) for window in loads(self.message(["query", "--windows"]))
|
|
|
+ ]
|
|
|
+ if window.has_focus
|
|
|
]
|
|
|
if len(windows) > 0:
|
|
|
return windows.pop()
|