yabai
yabai copied to clipboard
Problem with Sonoma 14.2.1
I have a working install of yabai & skhd on an M1 MacBook Pro with Sonoma 14.1.2 using yabai v6.0.1 and skhd v0.3.9, both installed using Homebrew. On this install, SIP is still enabled, as reported by csrutil status
.
I have tried to reproduce this install on an M3 Pro MacBook Pro with Sonoma 14.2.1. Initially I installed the default version from Homebrew, which resulted in Yabai v6.0.6, and using the same configuration files from the M1 MacBook. None of the Yabai shortcuts defined in skhd seem to work. SIP is still enabled on this MacBook (it is required for the features I use).
Sometimes I get:
yabai -V
yabai: could not acquire lock-file! abort..
Whilst other times, after restarting the service, I get output from this command.
Since v6.0.6 didn't appear to work, I removed it and then installed v6.0.1 to mirror the installation on the M1 MacBook. [process here was to install the Brew Tap, checkout the v6.0.1 tag, then run brew install
]. But this still doesn't work. I again sometimes see the lock file error above. However, yabai -m query --windows
does sometimes give some output. skhd -o
shows key codes for the shortcuts defined for Yabai.
There's no content in Yabai's err.log
I've checked that Yabai is enabled for Accessibility access, and been through the recommended System Settings. I've stopped and started and re-started Yabai, rebooted the MacBook. I've checked that there's only one yabai running with ps -ef
Please can someone point out to me what am I doing wrong?
Had the same issue, was able to resolve by updating the shasum hash in the sudoers file.
Take a look at these instructions: https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#configure-scripting-addition
Note the comment "this hash must be updated manually after running brew upgrade".
I've been all good on 14.2.1. I was on 6.0.1 which caused SA to not work; but after moving to 6.0.4, SA started working again (using nix to manage my packages, and that's the latest available version currently).
try doing rm /tmp/yabai*
Thanks for the suggestions everyone, but nothing seems to have helped. I tried all the suggestions both with v6.0.1 and v6.0.6, but the shortcut keys are still not working.
I'm not using the scripting addition, since I wasn't on my older MacBook M1. Is that a new requirement for the basic functionality? (I also note that would require partial deactivation of SIP, which I'm not overly keen on).
Despite yabai -V
showing me this: yabai: could not acquire lock-file! abort..
, some of Yabai's functionality does seem to work. For example, if I yabai --restart-service
the windows in my current space seem to be re-arranged. I can also change which window has focus using:
yabai -m window --focus east
yabai -m window --focus west
So I'm wondering if the problem actually lies on the skhd->yabai interface rather than actually with Yabai itself?
FWIW I currently have the following versions installed:
skhd: skhd-v0.3.9 yabai: yabai-v6.0.6
The shasum in the sudoers file is correct. I feel I must be doing something really basic wrong, but I'm unable to find the problem myself.
what works for me is running
pgrep -fl yabai
then
killall yabai
Then, try pgrep -fl yabai
again, if there's still a yabai process running, run killall yabai
again, it should be 2 times that you do this, then you should be able to run yabai -V
TLDR: run pgrep -fl yabai
then killall yabai
, loop this process until pgrep -fl yabai
returns no output, run yabai -V
.
I had the same issue with yabai v6.0.1. Just upgraded it to 6.0.6 by homebrew, then updated the shasum hash in the sudoers file.
Thanks for those new suggestions. I've tried them all and still no luck. Yabai steadfastly refuses to consume any keyboard shortcuts from skhd.
Thanks for those new suggestions. I've tried them all and still no luck. Yabai steadfastly refuses to consume any keyboard shortcuts from skhd.
Is this an intermittent issue? I've found that skhd won't take commands if Secure Input is enabled, which happens when e.g. I'm in a password field in a browser. That is done at the OS level I believe to prevent keystroke loggers from sniffing out your passwords. Maybe your machine is stuck in that mode? At some point I figured out how to tell if my system was in Secure Input mode - I had a menubar icon that would tell me when I was in Secure Input mode, but I can't remember the name of the utility now. I think it was one of those snippet apps. Anyway, just an idea.
Thanks for the suggestion @ashleyharvey . This isn't an intermittent issue, unfortunately. It survives reboots & sleep/ wake cycles.
Thanks for the suggestion @ashleyharvey . This isn't an intermittent issue, unfortunately. It survives reboots & sleep/ wake cycles.
Is skhd
listed in Security & Privacy > Accessibility? It really sounds like skhd isn't receiving keystrokes. I would start there.
Is
skhd
listed in Security & Privacy > Accessibility? It really sounds like skhd isn't receiving keystrokes. I would start there.
Yes, it is listed there and "switched on".
skhd --version
skhd-v0.3.9
And skhd -V
shows the keybindings configured.
After a brew upgrade
I now have Yabai v6.0.9, still the same skhd, and now skhd -V
shows:
skhd -V
skhd: could not lock pid-file! abort..
After a
brew upgrade
I now have Yabai v6.0.9, still the same skhd, and nowskhd -V
shows:skhd -V skhd: could not lock pid-file! abort..
Yeah, you need to skhd --stop-service
first, otherwise the lock file will be in place. Same is true for yabai
.
Restart the service with skhd --start-service
once you're done running it in verbose/debugging mode.
After a
brew upgrade
I now have Yabai v6.0.9, still the same skhd, and nowskhd -V
shows:skhd -V skhd: could not lock pid-file! abort..
or you can do rm /tmp/skhd*
After a
brew upgrade
I now have Yabai v6.0.9, still the same skhd, and nowskhd -V
shows:skhd -V skhd: could not lock pid-file! abort..
or you can do
rm /tmp/skhd*
I mean.. if you're going to suggest rm'ing a process lock file you should probably also warn the user about what they're potentially about to do. skhd
creates the lock file for a reason, just shut it down gracefully and let the process remove the file.
Ok yeah that is true, but i had encountered an issue where yabai gets stuck stopping its service, so i just force removed the lockfile. Also if it's still not working try uninstalling yabai and all its related files. That fixed it for me for Sonoma. https://github.com/koekeishiya/yabai/wiki/Uninstalling-yabai
Also check that your bootargs are correct. But since yabai command works i doubt thats a problem.
I finally found a bit of time to do some more investigations, prompted by the recent Yabai update from Homebrew. I'm ever more convinced this is actually an skhd
problem. Here are the steps I took:
brew upgrade
brew uninstall --force skhd
rm -rf /tmp/skhd-*
brew install skhd
Then, I started the skhd service:
skhd --start-service
However, Yabai still didn't respond to the configured shortcut keys. So, I then ran:
rm /tmp/skhd-*
skhd -V
And then saw this in the terminal running skhd
:
yabai-msg: failed to connect to socket..
Following the instructions in this post I delete the Yabai socket and restarted the service, and Yabai received commands from skhd! So I then killed the skhd
process running in the terminal, and:
rm /tmp/skhd_*
skhd --restart-service
And no luck - Yabai once again was unresponsive to shortcut key presses. If I stop the service (skhd --stop-service
) and restart the process in the terminal skhd -V
Yabai works once again. So it seems to me that there's something amiss with the launchd service?
This issue looks relevant, but after changing the paths, skhd
running as a service still does not send commands to yabai
https://github.com/koekeishiya/skhd/issues/312
Do you have anything in your /tmp/skhd_*.err.log?
On Feb 17, 2024, at 3:27 AM, James Osborne @.***> wrote:
This issue looks relevant, but after changing the paths, skhd running as a service still does not send commands to yabai koekeishiya/skhd#312 https://github.com/koekeishiya/skhd/issues/312 — Reply to this email directly, view it on GitHub https://github.com/koekeishiya/yabai/issues/2049#issuecomment-1949942256, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2TRSPSA7X2JOGXJ3SE5CLYUCH3NAVCNFSM6AAAAABBWQPBNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZHE2DEMRVGY. You are receiving this because you were mentioned.
To verify if yabi is the problem simply open a terminal and manually run: yabai -m config layout
. If you get proper output yabai is running correctly.
I assume the problem was likely skhd lacking accessibility permissions. It must be codesigned before macOS will grant it permissions. One of the last days I added ad-hoc signing to skhd in the homebrew formula to make it easier for people who are not that familiar with how this works.
Simply uninstalling skhd completely, and then installing it again should resolve this issue. Please do a full uninstall, remove accessbility access, reboot cycle, before installing again.