yabai: 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.

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 12
  • Comments: 17

Most upvoted comments

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 homebrew brew 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 viayabai -m space --create
  • ✅ Focus via yabai -m space --focus next

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!"

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 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

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.