yabai icon indicating copy to clipboard operation
yabai copied to clipboard

Reload yabai without restarting it

Open crisidev opened this issue 7 months ago • 1 comments

I noticed that if I attach/detach a monitor from my laptop, yabai is not to moving the windows to their assigned space. The only way to achieve this is to restart yabai after the display change event.

I guess this is because MacOS changes the space indexing after a display event or something like it.

I was wondering if there is a way to tell yabai to "reload" without restarting it. Ideally I would like to do something like this:

yabai -m signal --add event=display_added action="sleep5 && yabai --reload && do_a_bunch_of_other_things" yabai -m signal --add event=display_removed action="sleep 5 && yabai --reload && do_a_bunch_of_other_things"

Is there a way to achieve something like this already? I have tried to fully restart yabai inside the event action, but that cannot really work as the action is basically interrupted by the yabai restart and do_a_bunch_of_other_things is never executed.

FYI I cannot enable the scripting addition on this system, maybe that already solves this issue.

crisidev avatar Nov 26 '23 11:11 crisidev