yabai icon indicating copy to clipboard operation
yabai copied to clipboard

Problem with Sonoma 14.2.1

Open jjo93sa opened this issue 1 year ago • 8 comments

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?

jjo93sa avatar Jan 11 '24 13:01 jjo93sa

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

stephanspiegel avatar Jan 11 '24 17:01 stephanspiegel

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

lukejcollins avatar Jan 12 '24 13:01 lukejcollins

try doing rm /tmp/yabai*

williamhCode avatar Jan 13 '24 02:01 williamhCode

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.

jjo93sa avatar Jan 13 '24 14:01 jjo93sa

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.

lmBored avatar Jan 17 '24 21:01 lmBored

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.

accessd avatar Jan 18 '24 08:01 accessd

Thanks for those new suggestions. I've tried them all and still no luck. Yabai steadfastly refuses to consume any keyboard shortcuts from skhd.

jjo93sa avatar Jan 21 '24 15:01 jjo93sa

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.

ashleyharvey avatar Feb 01 '24 06:02 ashleyharvey

Thanks for the suggestion @ashleyharvey . This isn't an intermittent issue, unfortunately. It survives reboots & sleep/ wake cycles.

jjo93sa avatar Feb 06 '24 13:02 jjo93sa

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.

ashleyharvey avatar Feb 06 '24 19:02 ashleyharvey

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.

jjo93sa avatar Feb 07 '24 14:02 jjo93sa

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

jjo93sa avatar Feb 07 '24 14:02 jjo93sa

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

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.

ashleyharvey avatar Feb 07 '24 23:02 ashleyharvey

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

or you can do rm /tmp/skhd*

williamhCode avatar Feb 08 '24 20:02 williamhCode

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

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.

ashleyharvey avatar Feb 08 '24 20:02 ashleyharvey

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.

williamhCode avatar Feb 10 '24 18:02 williamhCode

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?

jjo93sa avatar Feb 17 '24 10:02 jjo93sa

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

jjo93sa avatar Feb 17 '24 11:02 jjo93sa

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.

ashleyharvey avatar Feb 18 '24 22:02 ashleyharvey

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.

koekeishiya avatar Mar 12 '24 01:03 koekeishiya