Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot focus space due to an error with the scripting edition #1532

Closed
ando600 opened this issue Nov 19, 2022 · 17 comments
Closed

Cannot focus space due to an error with the scripting edition #1532

ando600 opened this issue Nov 19, 2022 · 17 comments

Comments

@ando600
Copy link

ando600 commented Nov 19, 2022

Hi,
I am new to yabai, and am trying to figure everything out. It seems that I have yabai and skhd setup and everything mostly works. I have followed the instructions regarding adding
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
sudo yabai --load-sa

to the top of my .yabairc file.

When I use shift + alt -5 : yabai -m window --space 5, everything works as I would expect. However, when I try to move to space 5 with yabai -m space --focus 5, I get the error cannot focus due to an error in the scripting edition.

This is very confusing since I seem to be able to use some scripts but not others. Any help is appreciated.

Thanks,

Andrew

@attiliosbrana
Copy link

After updating to Ventura, "--focus" is broken for me. I does have some effect, for example, it focuses the monitor where the space is, but it doesn't change the space, it stays in the space that was already opened.

@timhradil
Copy link

timhradil commented Dec 2, 2022

This issue has been fixed and merged into master, but not released: 206c0d6.

You can install from HEAD using these steps from wiki: https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(from-HEAD)

I found my yabai at this path: /opt/homebrew/Cellar/yabai/HEAD-206c0d6/bin/yabai. Rather than at /usr/local/bin/yabai as noted in the wiki.

@lucafulgenzi
Copy link

I confirm that by installing the HEAD version, everything works correctly.
I also confirm that that the path of yabai is not the one that comes out with the which yabai command, but I recommend looking for it manually in the homebrew folders.

@attiliosbrana
Copy link

I have tried multiple solutions that I've found and I cannot make Yabai --HEAD work, it won't stop asking for Accessibility access.

I created the certificate 'yabai-cert' following the instructions and I signed at the right path:
codesign -fs 'yabai-cert' /opt/homebrew/Cellar/yabai/HEAD-206c0d6/bin/yabai

However, it keeps asking me for Accessibility access, and it doesn't work.

@timhradil
Copy link

I used the $(which yabai) for creating the certificate. I just had to use the /opt/homebrew path for adding yabai to accessibility access manually.

@ando600
Copy link
Author

ando600 commented Dec 4, 2022

I can confirm attiliosbrana's behavior. I have installed yabai from head, and code signed, but when I run brew services start yabai, a popup asking for accessibility access keeps coming up, and even after I specifically point to the location I just code signed in the opt/homebrew/Cellar directory.

@ando600
Copy link
Author

ando600 commented Dec 4, 2022

However when I uninstall and reinstall yabai normally, (i.e. without the --HEAD tag), I do not get this accessibility popup behavior, but the scripting edition error persists.

@ysomad
Copy link

ysomad commented Dec 10, 2022

I have the same issue on Monterey 12.6.1
Disabled SIP, cert is created and signed, yabai from master
Getting yabai: scripting-addition failed to inject payload into Dock.app! in the logs.

had the same issue in release version

@koekeishiya
Copy link
Owner

Install the latest version (v5.0.2). Make sure you have followed the wiki instructions exactly as written.
If you still have issues, read this comment for instructions on how to debug your setup: #1515 (comment)

@Iddodo
Copy link

Iddodo commented Dec 18, 2022

This might be a newbie question of sorts, but why am I getting this message and how can it be fixed?

codesign -fs 'yabai-cert' /opt/homebrew/Cellar/yabai/HEAD-03b2483/bin/yabai

error: The specified item could not be found in the keychain.

@behaghel
Copy link

behaghel commented Dec 23, 2022

@Iddodo it's definitely a newbie answer but I am stuck here like you with the added challenge of doing it the nix way. I suspect it has to do with the following command returning 0 valid identities found

security find-identity -p codesigning -v

I have this would change that (you need to export as .cer yabai-cert in Keychain Access)

sudo security add-trusted-cert -d -r trustRoot /path/to/yabai-cert.cer

This has not unblocked me but I suspect nix can't see the keychain I am working on. Let me if it helps.

@rkshthrmsh
Copy link

rkshthrmsh commented Feb 18, 2023

Still seeing this issue on Ventura 13.2.1: yabai-v5.0.2 & SIP disabled (need the ability to focus spaces that are created manually).

  • Created yabai-cert as per instructions in the wiki
  • Used brew to install from HEAD
  • Could NOT find yabai installed in /usr/local/bin as per the wiki instructions. Codesigned yabai here instead:
> codesign -fs 'yabai-cert' /opt/homebrew/bin/yabai
> codesign -fs 'yabai-cert' /opt/brew/Cellar/yabai/HEAD-147b356/bin/yabai
  • Provided accessibility permission to the executables at /opt/brew/bin/yabai/ and /opt/brew/Cellar/yabai/HEAD-147b356/bin/yabai since there was nothing in the local bin.

Issue:

> yabai -m space --focus next   
cannot focus space due to an error with the scripting-addition.

Moving windows to open spaces is working however.

Is there anything wrong here, or something else that I can try? Please let me know.

@ando600
Copy link
Author

ando600 commented Feb 19, 2023

I am seeing the same behavior as rkshthrmsh

@jin-ahn
Copy link

jin-ahn commented Mar 14, 2023

any updates? I am on 13.2 and have the issues as @rkshthrmsh

@olivercarter
Copy link

Same issue as ando600, mac big sur 11.2.2

@jjpark78
Copy link

Same issue as others, mac ventura 13.3.1 (a)

@koekeishiya
Copy link
Owner

Follow the wiki instructions precisesly as written, and it will work. Some info on how to debug your setup here: #1515 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests