|
|
@@ -319,31 +319,6 @@ class Yabai:
|
|
|
f"action=/bin/zsh {HOME}/.scripts/lightmode.zsh",
|
|
|
]
|
|
|
)
|
|
|
- # When focusing an that may share a space with at least two others, rotate the
|
|
|
- # space's windows to ensure that the focused window is the largest.
|
|
|
- for label, _, apps in self.spaces:
|
|
|
- if len(apps) < 3:
|
|
|
- continue
|
|
|
- for app in apps:
|
|
|
- self.message(
|
|
|
- [
|
|
|
- "signal",
|
|
|
- "--add",
|
|
|
- "event=window_focused",
|
|
|
- f"app={app}",
|
|
|
- f"label={app}RotateToFocus",
|
|
|
- f"action=python3 {XDG_CONFIG_HOME}/yabai/yabai.py rotate",
|
|
|
- ]
|
|
|
- )
|
|
|
-
|
|
|
- def rotate(self) -> None:
|
|
|
- windows = self.get_windows()
|
|
|
- focus_window = next(w for w in windows if w.has_focus)
|
|
|
- same_space_windows = sorted((w for w in windows if w.space == focus_window.space), key = lambda w: w.size)
|
|
|
- if same_space_windows[-1].has_focus:
|
|
|
- return
|
|
|
- self.message(["window", focus_window.id, "--swap", same_space_windows[-1].id])
|
|
|
- return
|
|
|
|
|
|
def get_focused_window(self) -> int:
|
|
|
return [
|
|
|
@@ -356,11 +331,9 @@ class Yabai:
|
|
|
if __name__ == "__main__":
|
|
|
basicConfig(level=NOTSET)
|
|
|
debug(f"Called with parameters {argv}")
|
|
|
- if argv[1] == "manage" or argv[1] == "initialize":
|
|
|
- with Yabai() as yabai:
|
|
|
+ with Yabai() as yabai:
|
|
|
+ if argv[1] == "manage" or argv[1] == "initialize":
|
|
|
yabai.manage_displays()
|
|
|
yabai.manage_spaces()
|
|
|
if argv[1] == "initialize":
|
|
|
yabai.set_rules_and_signals()
|
|
|
- if argv[1] == "rotate":
|
|
|
- Yabai().rotate()
|