yabai
yabai copied to clipboard
More Spaces Signals
It'd be great if there were some more signals related to Spaces, ideally a signal for each action that Yabai can do to a space (ie Create, Delete, Move, etc.). There is one already:
space_changed
Triggered when the active space has changed.
Passes two arguments: $YABAI_SPACE_ID, $YABAI_RECENT_SPACE_ID
It'd be great if there were additionally:
space_created
Triggered when a space has beed created.
Passes two arguments: $YABAI_NEW_SPACE_ID, $YABAI_CURRENT_SPACE_ID
space_deleted
Triggered when a space has been deleted.
Passes two arguments: $YABAI_DELETED_SPACE_ID, $YABAI_NEXT_SPACE_ID
space_moved
Passes two arguments: $YABAI_SPACE_ID, $YABAI_DISPLAY_ID
Another option is that we can customize/create new ones, but please 🙏🏻 take a look on this issue
I'd love this as well: signals for space created and destroyed would be very useful for triggering updates of status bars/widgets. Depending on how ids change when a space is created/destroyed, it could make sense to pass the uuid, or maybe to have just a generic "space count updated" signal that passes no args could do double-duty for both create and destroy: the handler could query the spaces and decide what to do. AFAICT there is no way to listen for these events currently.
Additionally, a signal for space label changed would allow for some interesting workflows as well.
space_created
and space_destroyed
added on master (Ventura only for now as we depend on a system event that I'm not sure exists in earlier versions).
Unable to test/look for space_moved
as I only have a single monitor available for now.
https://github.com/koekeishiya/yabai/commit/a51af04ccaac1dbef412d4b1069e49bc9f2df816