yabai
yabai copied to clipboard
Space commands not working with MacOS Sonoma 14.0
Hello,
just wanted to ask if anybody noticed space commands stopped working after updating to MacOS Sonoma 14.0. Commands such as
yabai -m space --focus 3
or yabai -m space --create
yield no error but have no effect either. I can see they're somewhat working because when I attempt to switch to the currently active space, yabai informs me that: cannot focus an already focused space.
.
What I've tried so far is uninstalling and installing yabai, following all of the required configuration steps. But perhaps there is something else I should do after upgrading to Sonoma?
Keep in mind other commands I am using (e.g. yabai -m window --grid 1:2:0:0:1:1
) work as expected.
I have the same issue. Curiously focusing a space works, when another screen than the one the space belongs to, is in focus when issuing the command
@tromars thanks for chiming in.
I myself am not using an additional monitor so it does not work for me at all...
Can confirm
I have the same issue, yabai also restarts on each failed space command
Same here. no effect at all.
yabai -m window --space next --focus
works though.
It moves the current window to the next space and focuses on the next space. weird.
I can confirm this as well.
EVENT_HANDLER_APPLICATION_LAUNCHED: osascript (25808) is not observable, subscribing to activationPolicy changes
EVENT_HANDLER_APPLICATION_TERMINATED: osascript (25808) (not observed)
EVENT_HANDLER_APPLICATION_LAUNCHED: osascript (25814) is not observable, subscribing to activationPolicy changes
EVENT_HANDLER_APPLICATION_TERMINATED: osascript (25814) (not observed)
EVENT_HANDLER_APPLICATION_LAUNCHED: osascript (25820) is not observable, subscribing to activationPolicy changes
EVENT_HANDLER_APPLICATION_LAUNCHED: osascript (25826) is not observable, subscribing to activationPolicy changes
... (same output as above with different ids)
EVENT_HANDLER_APPLICATION_LAUNCHED: osascript (25842) is not observable, subscribing to activationPolicy changes
EVENT_HANDLER_APPLICATION_TERMINATED: osascript (25842) (not observed)
EVENT_HANDLER_APPLICATION_LAUNCHED: osascript (25852) is not observable, subscribing to activationPolicy changes
EVENT_HANDLER_APPLICATION_LAUNCHED: osascript (25847) is not observable, subscribing to activationPolicy changes
EVENT_HANDLER_APPLICATION_TERMINATED: osascript (25847) (not observed)
EVENT_HANDLER_APPLICATION_TERMINATED: osascript (25852) (not observed)
EVENT_HANDLER_APPLICATION_LAUNCHED: osascript (25858) is not observable, subscribing to activationPolicy changes
EVENT_HANDLER_APPLICATION_TERMINATED: osascript (25858) (not observed)
EVENT_HANDLER_APPLICATION_LAUNCHED: osascript (25863) is not observable, subscribing to activationPolicy changes
EVENT_HANDLER_APPLICATION_TERMINATED: osascript (25863) (not observed)
EVENT_HANDLER_APPLICATION_LAUNCHED: osascript (25864) is not observable, subscribing to activationPolicy changes
EVENT_HANDLER_APPLICATION_TERMINATED: osascript (25864) (not observed)
EVENT_HANDLER_WINDOW_TITLE_CHANGED: kitty 378
EVENT_HANDLER_WINDOW_TITLE_CHANGED: kitty 378
EVENT_HANDLER_DAEMON_MESSAGE: space --focus 3
EVENT_HANDLER_WINDOW_TITLE_CHANGED: kitty 378
event_signal_flush: transmitting window_title_changed to 1 subscriber(s)
EVENT_HANDLER_WINDOW_TITLE_CHANGED: kitty 378
EVENT_HANDLER_WINDOW_TITLE_CHANGED: kitty 378
event_signal_flush: transmitting window_title_changed to 1 subscriber(s)
EVENT_HANDLER_WINDOW_TITLE_CHANGED: kitty 378
EVENT_HANDLER_WINDOW_TITLE_CHANGED: kitty 378
EVENT_HANDLER_DAEMON_MESSAGE: query --windows --window
EVENT_HANDLER_DAEMON_MESSAGE: query --windows --window
EVENT_HANDLER_DAEMON_MESSAGE: query --windows --window
EVENT_HANDLER_DAEMON_MESSAGE: query --windows --window
This is the debug output when running yabai -m space --focus 3
.
Is the osascript log line relevant here?
I can also confirm:
$ yabai -m space --focus 4
cannot focus space due to an error with the scripting-addition.
$ yabai --version
yabai-v5.0.9
Likewise, issue with spaces and overal rendering.
This was initially broken for me on Sonoma 14.0, I was able to resolve this by:
- Re-Ran
sudo nvram boot-args=-arm64e_preview_abi
- Restart
- Updated Yabai to
v5.0.9
via homebrewbrew upgrade koekeishiya/formulae/yabai
- Individually added Yabai to privacy settings: Screen Recording & Accessibility
I don't know the exact step that resulted in the fix here, I assume it may be permissions related.
Confirming I am now able to:
- ✅ Create new spaces via
yabai -m space --create
- ✅ Focus via
yabai -m space --focus next
@karsonenns your steps worked for me. Thanks! :)
Can confirm, karsonenns steps + rerunning the scripting-addition setup (new hash for the upgrade) got my spaces working again. Thanks a bunch yall.
I have same problem, had tried @karsonenns steps but still not working.
Upgrade and try to config "scripting-addition" again: https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#configure-scripting-addition I got "cannot focus space due to an error with the scripting-addition" info. Now it worked.
I created a script to do this, you need to do this each time you update yabai because the hash of the program has changed.
Make sure to put your username in the script
#!/bin/bash
# Get the SHA-256 hash of the yabai program
YABAI_PATH=$(which yabai)
if [ -z "$YABAI_PATH" ]; then
echo "yabai not found!"
exit 1
fi
HASH=$(shasum -a 256 "$YABAI_PATH" | awk '{print $1}')
# Check if HASH is non-empty
if [ -z "$HASH" ]; then
echo "Failed to get hash for yabai!"
exit 1
fi
# Construct the new sudoers entry
SUDOERS_ENTRY="{your_username} ALL=(root) NOPASSWD: sha256:$HASH $YABAI_PATH --load-sa"
# Write the entry to /private/etc/sudoers.d/yabai
echo "$SUDOERS_ENTRY" | sudo tee /private/etc/sudoers.d/yabai > /dev/null
# Set the appropriate permissions for the sudoers file
sudo chmod 0440 /private/etc/sudoers.d/yabai
echo "Updated /private/etc/sudoers.d/yabai successfully!"
@kabeersvohra's script worked for me! I also had to run yabai --restart-service
afterwards for the changes to reflect as well!
@kabeersvohra you can use id -un
or whoami
to get the current username.
Upgrade and try to config "scripting-addition" again: https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#configure-scripting-addition I got "cannot focus space due to an error with the scripting-addition" info. Now it worked.
I updated and reconfigured the sudoers file, and now I'm able to switch spaces without any issues.