koekeishiya / yabai

A tiling window manager for macOS based on binary space partitioning
MIT License
23.25k stars 641 forks source link

Could not find service "com.koekeishiya.yabai" in domain for user gui: 501 #2159

Closed tamasgal closed 6 months ago

tamasgal commented 6 months ago

I updated to the latest HEAD today but the floating windows stopped working. I decided to install again the current stable (6.0.15) but now yabai won't start. I get

Could not find service "com.koekeishiya.yabai" in domain for user gui: 501

I think I've got everything correct (and did not change my configuration that worked for the past weeks):

░ tamasgal@silentbox-(6):~
░ 10:36:28 > which -a yabai
/opt/homebrew/bin/yabai
/opt/homebrew/bin/yabai

░ tamasgal@silentbox-(6):~
░ 10:36:29 > shasum -a 256 $(which yabai)
f74c0a38527151ea4ccf07df053a47d42663226d078c76dd4b84fdd2c3b5c613  /opt/homebrew/bin/yabai

░ tamasgal@silentbox-(6):~
░ 10:36:42 > sudo cat /private/etc/sudoers.d/yabai
tamasgal ALL=(root) NOPASSWD: sha256:f74c0a38527151ea4ccf07df053a47d42663226d078c76dd4b84fdd2c3b5c613 /opt/homebrew/bin/yabai --load-sa

SIP is disabled, I did sudo nvram boot-args=-arm64e_preview_abi and the Privacy & Security -> Accessibility is enabled for yabai:

Screenshot 2024-03-13 at 10 38 27

Any ideas?

tamasgal commented 6 months ago

I also tried again with HEAD, but now stuck with the same error ("Could not find service..."). I didn't even get a prompt this time for the Accessibility access, the list is now empty (I deleted the old entries before).

░ tamasgal@silentbox-(6):~ took 18s
░ 10:40:02 > codesign -fs 'yabai-cert' $(brew --prefix yabai)/bin/yabai
/opt/homebrew/opt/yabai/bin/yabai: replacing existing signature

░ tamasgal@silentbox-(6):~
░ 10:40:20 > which -a yabai
/opt/homebrew/bin/yabai
/opt/homebrew/bin/yabai

░ tamasgal@silentbox-(6):~
░ 10:40:25 > ls -al /opt/homebrew/bin/yabai
lrwxr-xr-x  1 tamasgal  admin  38 Mar 13 10:40 /opt/homebrew/bin/yabai -> ../Cellar/yabai/HEAD-a9578e3/bin/yabai

░ tamasgal@silentbox-(6):~
░ 10:40:29 > echo "$(whoami) ALL=(root) NOPASSWD: sha256:$(shasum -a 256 $(which yabai) | cut -d " " -f 1) $(which yabai) --load-sa" | sudo tee /private/etc/sudoers.d/yabai
tamasgal ALL=(root) NOPASSWD: sha256:4ca4b4b804cceddd336259af0452a26b1e0cfccf7893595c4474c91fb0bc9380 /opt/homebrew/bin/yabai --load-sa

░ tamasgal@silentbox-(6):~
░ 10:40:53 > yabai --restart-service
Could not find service "com.koekeishiya.yabai" in domain for user gui: 501
koekeishiya commented 6 months ago

The service file contains the path of the yabai binary and this likely changes when installing upgrades using brew. Run yabai --uninstall-service followed by yabai --install-service or yabai --start-service.

tamasgal commented 6 months ago

Thanks for the prompt reply, I just figured out that yabai --restart-service fails if there is no service (which I removed before). I need to do at least once yabai --start-service, not restart 🙈

tamasgal commented 6 months ago

I also realised that there is a breaking change in HEAD which drops the layer option (https://github.com/koekeishiya/yabai/issues/2128):

░ tamasgal@silentbox-(6):~
░ 10:49:08 > yabai -m rule --add app="^System Settings$" layer=above manage=off
yabai -m rule --add app="^Calculator$" layer=above manage=off
yabai -m rule --add app="^Finder$" layer=above manage=off
yabai -m rule --add app="^Karabiner-Elements$" layer=above manage=off
yabai -m rule --add app="^MenuMeters$" layer=above manage=off
yabai -m rule --add app="^Step Two$" layer=above manage=off
yabai -m rule --add app="^Messages$" layer=above manage=off
yabai -m rule --add app="^Calendar$" layer=above manage=off
yabai -m rule --add app="^Signal$" layer=above manage=off
unknown key 'layer'
unknown key 'layer'
unknown key 'layer'
unknown key 'layer'
unknown key 'layer'
unknown key 'layer'
unknown key 'layer'
unknown key 'layer'
unknown key 'layer'

That's the reason why my floating was broken on HEAD ;)