Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it feasible/sensible to pass several messages to yabai at once? #1072

Closed
kiryph opened this issue Dec 2, 2021 · 7 comments
Closed

Is it feasible/sensible to pass several messages to yabai at once? #1072

kiryph opened this issue Dec 2, 2021 · 7 comments
Labels
suggestion Request for new feature or some form of enhancement

Comments

@kiryph
Copy link

kiryph commented Dec 2, 2021

I have two displays and want to change the spaces of both displays at once.

$ yabai -m space --focus 6; yabai -m space --focus 1;

There is a slight time gap between both displays changing the space.

Would the time gap be reduced if yabai could accept two or more messages at once?

The syntax would be like

$ yabai -m space --focus 6 -m space --focus 1
@koekeishiya
Copy link
Owner

Possibly, yes, although I am unsure how noticeable it would be.

Currently, you spawn a yabai process to send the message to the running instance of yabai. The running instance of yabai processes the message and sends a signal to the scripting addition running inside Dock.app. These steps then happen twice in your case, as you want to change space on two displays.

Allowing multiple messages would get rid of the overhead of spawning a process the second time around.
However, allowing multiple messages also has other implications that need to be thought through, like state consistency/behaviour upon errors and error reporting; there are a couple of ways to approach this.

@FelixKratz
Copy link

In SketchyBar implementing message batching helped a lot in responsiveness and reliability. Additionally, it cleans up the configuration file a bit. I had issues with messages getting lost if there where too many at any point in time and this change also helped to reduce lost messages. I am not sure if the lost messages where due to me bricking your server client code or if this could also be still a problem in yabai.

@koekeishiya
Copy link
Owner

I had issues with messages getting lost if there where too many at any point in time and this change also helped to reduce lost messages.

This issue was fixed in yabai way back. I assume sketchybar/spacebar didn't catch up with these changes after branching.

@koekeishiya
Copy link
Owner

koekeishiya commented Aug 25, 2022

#1371 may be of interest, but it isn't exactly the same as what this issue is about.

@koekeishiya koekeishiya added the suggestion Request for new feature or some form of enhancement label Aug 25, 2022
@kiryph
Copy link
Author

kiryph commented Aug 25, 2022

@koekeishiya I would like to test this. However, I have the same compilation error as #1200

I am not yet on Monterey and I do not want to upgrade my whole system just for testing this. I also do not have a Developer ID.

macOS version 11.6.8
XCode version: 13.2.1

@koekeishiya
Copy link
Owner

koekeishiya commented Aug 25, 2022

Hm I can build from source just fine on my Big Sur machine. With that version of Xcode your Apple SDKs should be updated to include that definition: https://developer.apple.com/documentation/appkit/nsscreen/3882821-safeareainsets?language=objc

@kiryph
Copy link
Author

kiryph commented Sep 8, 2022

Now, I could test it with following example command to change on three displays at the same time the space:

yabai -m space --focus 3 --focus 8 --focus 13

which works great.

However, I cannot quantify the speed improvement compared to
yabai -m space --focus 3; yabai -m space --focus 8; yabai -m space --focus 13

@kiryph kiryph closed this as completed Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Request for new feature or some form of enhancement
Projects
None yet
Development

No branches or pull requests

3 participants