yabai icon indicating copy to clipboard operation
yabai copied to clipboard

macOS 13 Ventura

Open koekeishiya opened this issue 2 years ago • 14 comments

This is the collective yearly thread for macOS betas. Please use this to discuss instead of opening new issues.

koekeishiya avatar Jun 07 '22 16:06 koekeishiya

I have the first beta up and running in a separate APFS volume.

❯ sw_vers
ProductName:	macOS
ProductVersion:	13.0
BuildVersion:	22A5266r

Relevant system files:

Initial observations:

  • Scripting addition doesn't work yet, which is expected.
  • With yabai running the NotificationCenter process sometimes crashes.
  • Stage Manager sucks, but if it's running yabai should switch to floating mode for everything, instead of attempting to tile windows that are in the Stage Manager sidebar, producing effects similar to #68.
  • Yabai is running surprisingly stable given the subset I played around with so far.

For reference, here's the yabai window status for a window currently hidden in Stage Manger. Yabai think's it's visible, when in reality it is not, thus causing all other windows on the space to be wrongly tiled.

❯ yabai -m query --windows --space | jq '.[] | select(.app == "Safari")'
{
  "id": 8204,
  "pid": 581,
  "app": "Safari",
  "title": "macOS 13 Ventura · Issue #1297 · koekeishiya/yabai",
  "frame": {
    "x": -120,
    "y": -1055,
    "w": 948,
    "h": 1055
  },
  "role": "AXWindow",
  "subrole": "AXStandardWindow",
  "display": 2,
  "space": 6,
  "level": 0,
  "opacity": 1,
  "split-type": "vertical",
  "stack-index": 0,
  "can-move": true,
  "can-resize": true,
  "has-focus": false,
  "has-shadow": true,
  "has-border": false,
  "has-parent-zoom": false,
  "has-fullscreen-zoom": false,
  "is-native-fullscreen": false,
  "is-visible": true,
  "is-minimized": false,
  "is-hidden": false,
  "is-floating": false,
  "is-sticky": false,
  "is-topmost": false,
  "is-grabbed": false
}

dominiklohmann avatar Jun 07 '22 16:06 dominiklohmann

Is Stage Manager like entering a different mode for that specific desktop? Can an application that is a part of Stage Manager have a window on a different display that is visible and managed by yabai? I guess I probably have to set up a separate volume running Ventura as well to experiment.

I also took a quick look at the Dock.app you uploaded and it should be no problem to update the scripting-addition for this version as well.

koekeishiya avatar Jun 07 '22 17:06 koekeishiya

Stage Manager is a single toggle for all non-fullscreen spaces across multiple displays. It operates per non-fullscreen space.

Essentially it's like a fancy single-window mode that allows for grouping windows together by dragging them onto a stage on the left side of your screen. Used that way it could be an alternative to spaces as well.

dominiklohmann avatar Jun 07 '22 17:06 dominiklohmann

I can't seem to get yabai scripting addition loaded. I get this error. yabai: scripting-addition either failed to load or could not inject payload into Dock.app! Error: -1708

Output of csrutil status

System Integrity Protection status: unknown (Custom Configuration).

Configuration:
	Apple Internal: disabled
	Kext Signing: enabled
	Filesystem Protections: disabled
	Debugging Restrictions: disabled
	DTrace Restrictions: enabled
	NVRAM Protections: disabled
	BaseSystem Verification: enabled
	Boot-arg Restrictions: disabled
	Kernel Integrity Protections: disabled
	Authenticated Root Requirement: enabled

This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state.

When I run yabai --check-sa it returns a 0 exit code

Lalit64 avatar Jun 08 '22 08:06 Lalit64

Also get this.

ghost avatar Jun 10 '22 05:06 ghost

Managed to get the yabai scripting addition loaded by following the wiki. @Lalit64

Uzaaft avatar Jun 29 '22 09:06 Uzaaft

Managed to get the yabai scripting addition loaded by following the wiki. @Lalit64

Ok. I will try. 😁

Lalit64 avatar Jun 29 '22 14:06 Lalit64

The scripting-addition won't inject on macOS Ventura because the code requires a versioning change to use the Mach API: https://github.com/koekeishiya/yabai/blob/master/src/sa.m#L443. The code that is injected also needs to be updated.

I am not particularly interested in programming in my spare time these days, so I have not set up a Ventura partition and I haven't yet looked in details at the changes. My first quick impression has been that everything that currently works on Monterey will continue to work in the foreseeable future. I will pick development back up at some point in the future when I feel motivated/interested enough to do so.

koekeishiya avatar Jun 29 '22 15:06 koekeishiya

Any update?

How did you manage to get the script addition loaded?

jorpilo avatar Jul 14 '22 01:07 jorpilo

Hey, I ended up changing the code myself. #1337 has the changes to include checking with macos(13)

As said in the pull request, os version checking can be really improved and this is just a quick fix to at least get something working again...

jorpilo avatar Jul 25 '22 16:07 jorpilo

I am trying to get the offsets and signatures for Dock.app, I saw some comments in monterrey about how to get offsets but I am really lost about this.

If anyone is able to help I would appreciate it.

I can provide dock.app from ventura 13 beta 2 if needed

jorpilo avatar Jul 30 '22 04:07 jorpilo

@jorpilo I ended up downgrading my OS to Monterey 12.5.

AdamMomen avatar Aug 18 '22 13:08 AdamMomen

i really like to help. if someone can point out the right direction, would be very appreciated. sadly mac os sucks on wm, it’s pretty unusable for me without this awesome app :/

rsnullptr avatar Sep 11 '22 00:09 rsnullptr

I have done this, I hope it can somehow help and I wonder if someone can guide me and tell me if this is correct https://github.com/koekeishiya/yabai/pull/1337#issuecomment-1245495085

Jac-Zac avatar Sep 13 '22 19:09 Jac-Zac

How usable is this on the latest upgrade? Am I good to move over or should I wait?

theTechGoose avatar Oct 12 '22 18:10 theTechGoose

I wouldn't update unless you really are interested in testing something new on Ventura. If you are yabai is definitely quite good on the beta too, but there are obviously some missing features mainly in the scripting additions. Therefore, I repeat unless you are really interested in using Ventura and willing too not have all the features you may need do not update. On the other hand if you are interested in tinkering and trying to make it work go ahead and update it, but just do not complain if something is not working as you expected.

Jac-Zac avatar Oct 18 '22 12:10 Jac-Zac

@koekeishiya not sure if you've seen it, but Ventura is supposed to go live on Oct 24th, i.e., next Monday. Do you intend to update the scripting addition based on the RC? I can upload the required files as usual if that's the case.

dominiklohmann avatar Oct 18 '22 22:10 dominiklohmann

I can upload the required files as usual if that's the case.

I'll probably look at it during the weekend if you do

koekeishiya avatar Oct 19 '22 10:10 koekeishiya

Took me a while to get to this, but here's everything that should be needed. I can give it a spin post updated signatures, got the Ventura rc2 running now.

Dock.zip

SkyLight.framework.zip

❯ sw_vers
ProductName:		macOS
ProductVersion:		13.0
BuildVersion:		22A380

dominiklohmann avatar Oct 23 '22 15:10 dominiklohmann

I looked up the symbols on 12.x based on the signatures (because there's no documentation whatsoever of what they are actually pointing at), then found the differences for the newly released Dock version of Ventura. Hacky workaround, not extensively tested (and will definitely break in the future), here are my "signatures" (merely offsets tbh).

The version I've tried this on:

❯ sw_vers ProductName: macOS ProductVersion: 13.0 BuildVersion: 22A380

Dock sha256 (if this is not your hash, this will not work for you):

❯ openssl dgst -sha256 /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock SHA256(/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock)= 42e5df10be236aea57e24ee9b527b6bad7ceb86d5b189c4078fa672b22a38a4e

And finally, the patch file is attached. ventura_22A380_hack.txt

I'd recommend creating a patchfinder that works out of yabai, puts the required offsets into a json or something similar, then the payload will read from it and use it accordingly. This way it would be easier to maintain, and also if the patchfinder runs externally, it is possible (and easy) to make strong signatures that will not break every major.

doadam avatar Oct 25 '22 03:10 doadam

I'd recommend creating a patchfinder that works out of yabai, puts the required offsets into a json or something similar, then the payload will read from it and use it accordingly. This way it would be easier to maintain, and also if the patchfinder runs externally, it is possible (and easy) to make strong signatures that will not break every major.

See my comment: https://github.com/koekeishiya/yabai/issues/1091#issuecomment-995808162

koekeishiya avatar Oct 25 '22 03:10 koekeishiya

Awesome, compiled the latest master and everything works again. For other people upgrading, here is what I did:

git clone https://github.com/koekeishiya/yabai.git
cd yabai
make
make sign
sudo ./bin/yabai --uninstall-sa
sleep 3
sudo ./bin/yabai --load-sa
sleep 3
./bin/yabai

I think it's important to uninstall the old scripting additions, it might not be necessary though, and I had to run ./bin/yabai --load-sa twice for it to work again, anyhow, back to tiling / instant space switching with yabai! bye bye Stage Manager =)

Thanks so much koekeishiya!!

haarmannthiemann avatar Oct 25 '22 10:10 haarmannthiemann

Thank you for giving your time to this, @koekeishiya . yabai is a terrific tool, and I'm grateful for the work you put in so we can continue using it.

phyllisstein avatar Oct 25 '22 15:10 phyllisstein

Hey guys, awesome news. thanks a lot @koekeishiya 🙏🏼

I am running this, but i can't make it work as brew service.

brew install koekeishiya/formulae/yabai --HEAD
brew services start koekeishiya/formulae/yabai

the accessibility menu is prompt, permission is given, but the permission keeps prompting.

Also did the "trick" of stop start again, but the same behaviour. Running it as an executable on terminal works.

Any suggestions? Thanks again!

EDIT:

╭─rs at mbp64 in ~
╰─○ tail -f /opt/homebrew/var/log/yabai/yabai.err.log
yabai: could not access accessibility features! abort..
yabai: could not access accessibility features! abort..
yabai: could not access accessibility features! abort..


EDIT2: running on terminal work, but I have a error injecting SA

 ╭─rs at mbp64 in ~
╰─○ /opt/homebrew/bin/yabai
+ declare -A color
+ color["focused"]=0xE02d74da
+ color["normal"]=
+ color["preselect"]=0xE02d74da
+ yabai -m signal --add event=dock_did_restart 'action=sudo yabai --load-sa'
+ sudo yabai --load-sa
yabai: scripting-addition failed to inject payload into Dock.app!
....

if run once on the terminal works, run twice I have that error.

╭─rs at mbp64 in ~
╰─○ sudo /opt/homebrew/bin/yabai --uninstall-sa
╭─rs at mbp64 in ~
╰─○ sudo /opt/homebrew/bin/yabai --load-sa     
╭─rs at mbp64 in ~
╰─○ sudo /opt/homebrew/bin/yabai --load-sa
yabai: scripting-addition failed to inject payload into Dock.app!

if uninstalled on the terminal, and run the app, also receive that error.

╭─rs at mbp64 in ~
╰─○ sudo /opt/homebrew/bin/yabai --uninstall-sa
╭─rs at mbp64 in ~
╰─○ sudo /opt/homebrew/bin/yabai --uninstall-sa
╭─rs at mbp64 in ~
╰─○ /opt/homebrew/bin/yabai                    
+ yabai -m signal --add event=dock_did_restart 'action=sudo yabai --load-sa'
+ sudo yabai --load-sa
+ color["focused"]=0xE02d74da
+ color["normal"]=
+ color["preselect"]=0xE02d74da
+ yabai -m config layout bsp
+ yabai -m config top_padding 10
yabai: scripting-addition failed to inject payload into Dock.app!

rsnullptr avatar Oct 25 '22 22:10 rsnullptr

You need to follow this detailed instructions. https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(from-HEAD)

0xWaleed avatar Oct 26 '22 01:10 0xWaleed

Something seems to have changed regarding to how window ordering works in the SLSOrderWindow* function family, which makes the animations a bit rough:

https://user-images.githubusercontent.com/22680421/197950635-19d5c7fc-5d87-424c-8f00-fd7b775aba45.mp4

Additionally I have noticed that there is a WindowManager process now, which is probably Apples Stage Manager. The binary for this process resides in /System/Library/CoreServices/WindowManager.app/Contents/MacOS/WindowManager. Maybe there is some benefit looking into this application in more detail to get an idea how apple handles animations etc.

FelixKratz avatar Oct 26 '22 06:10 FelixKratz

You need to follow this detailed instructions. https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(from-HEAD)

Thanks you. missed the code sign and the manual add of it. 🙏🏼

rsnullptr avatar Oct 26 '22 07:10 rsnullptr

Something seems to have changed regarding to how window ordering works in the SLSOrderWindow* function family, which makes the animations a bit rough:

animation.mp4 Additionally I have noticed that there is a WindowManager process now, which is probably Apples Stage Manager. The binary for this process resides in /System/Library/CoreServices/WindowManager.app/Contents/MacOS/WindowManager. Maybe there is some benefit looking into this application in more detail to get an idea how apple handles animations etc.

a bit off topic, but what is that ui you are using? it reminds me of i3wm.

btw I also have that glitch animation. And noticed a bad behaviour with stage manager enabled - which i think it's fine, since SM sucks 😓

rsnullptr avatar Oct 26 '22 12:10 rsnullptr

Hi all. Thank you so much for your product. I have been using it for several years now. Please tell me, yabai on Ventura works, but for some reason it does not work to switch between desktops. Refreshed yabai/skhd several times, reloaded everything a bunch of times and so on. Nothing helps. I attach a screenshot from the console where you can see that "yabai -m query --windows" works correctly but "yabai -m space --focus 2" doesn't respond at all

Снимок экрана 2022-10-27 в 02 53 22

kalamov avatar Oct 26 '22 23:10 kalamov

With the newest(stable) MacOS 13.0 installed, I have installed Xcode 14.1 Release Candidate 2, and reinstalled the development version of yabai. There currently seems to be a issue with the Accessibility request popup. It keeps popping on after giving permission.

donny-son avatar Oct 27 '22 14:10 donny-son