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-addition #787

Closed
rmGFW opened this issue Jan 5, 2021 · 27 comments
Closed

cannot focus space due to an error with the scripting-addition #787

rmGFW opened this issue Jan 5, 2021 · 27 comments

Comments

@rmGFW
Copy link

rmGFW commented Jan 5, 2021

macOS version 11.1

csrutil status output is System Integrity Protection status: disabled

already tried reinstall scripting-addition sudo yabai --uninstall-sa && sudo yabai --install-sa

@rmGFW
Copy link
Author

rmGFW commented Jan 5, 2021

yabai-v3.3.6

@rockyzhang24
Copy link

After sudo yabai --install-sa, did you run sudo yabai --load-sa manually? If not, try to run it.

@rmGFW
Copy link
Author

rmGFW commented Jan 5, 2021

thanks ! it works ! 👍

@rockyzhang24
Copy link

rockyzhang24 commented Jan 5, 2021

@koekeishiya Will you consider to mention this (manually run sudu yabai --load-sa after the first installation) in the wiki? I saw many users have such a concern. In the first installation, sometimes sudo yabai --install-sa won't load sa automatically.
Thanks.

@koekeishiya
Copy link
Owner

@rockyzhang24
Copy link

rockyzhang24 commented Jan 5, 2021

Adding sudo yabai --load-sa at the top of yabairc just makes scripting-addition being loaded automatically at each startup of our machines. However, not everyone will reboot his machine after installation of yabai.

After the first installation of yabai, except for running sudo yabai --install-sa and brew services start yabai, we also need to run sudo yabai --load-sa manually on our own.

@koekeishiya
Copy link
Owner

Updated wiki.

@mihnsen
Copy link

mihnsen commented Oct 5, 2021

still on MacOS BigSur 11.6. Already tried
sudo yabai --uninstall-sa && sudo yabai --install-sa && sudo yabai --load-sa

@SichangHe
Copy link

scripting-addition failed to inject

$ yabai -m space --focus next
cannot focus space due to an error with the scripting-addition.
$ sudo yabai --load-sa 
Password:
yabai: scripting-addition failed to inject payload into Dock.app!

yabai-v4.0.0
macOS 12.01
M1 apple silicon

SIP is disabled

@alephpt
Copy link

alephpt commented Jan 28, 2022

same problem ^ but on Monterey 12.2

@rublev
Copy link

rublev commented Feb 15, 2022

same problem ^ but on Monterey 12.2

same here D: wish i could downgrade. did it work for u on 12.1? amethyst also broken on 12.2

@SichangHe
Copy link

opened a new issue #1158 on this problem

@usmajeed
Copy link

I'm getting "cannot focus space due to an error with the scripting-addition" on Ventura.

@palteksolution
Copy link

I'm getting "cannot focus space due to an error with the scripting-addition" on Ventura.

Same with me on Ventura.

@dsorenes
Copy link

dsorenes commented Nov 7, 2022

I'm getting "cannot focus space due to an error with the scripting-addition" on Ventura.

Same with me on Ventura.

It's fixed in the development version. 206c0d6 with #1297 as context.

You can install the development version by following the wiki. https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(from-HEAD). You'll be asked by homebrew to unlink the previous yabai, but after that and following the instructions on the wiki it works like a charm again. Don't forget to update the sha256 for the new binary.

@rkshthrmsh
Copy link

rkshthrmsh commented Feb 18, 2023

Still seeing this issue on Ventura 13.2.1: yabai-v5.0.2 & SIP disabled (only 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.

@b0lle
Copy link

b0lle commented Jul 29, 2023

I am facing the same issue:

yabai -m space --focus next                                08:48:42
cannot focus space due to an error with the scripting-addition.

Apple Silicon
Ventura 13.5
yabai-v5.0.6 (installed from brew)
SIP 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: enabled
	Authenticated Root Requirement: enabled

@now-ing
Copy link

now-ing commented Aug 31, 2023

I am facing the same issue:我面临着同样的问题:

yabai -m space --focus next                                08:48:42
cannot focus space due to an error with the scripting-addition.

Apple Silicon 苹果硅 Ventura 13.5  文图拉13.5 yabai-v5.0.6 (installed from brew) yabai-v5.0.6(从brew安装) SIP status:  SIP 状态:

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: enabled
	Authenticated Root Requirement: enabled

may be you should use
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa" sudo yabai --load-sa

in https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#configure-scripting-addition says

@dandehavilland
Copy link

Don't forget to update the sha256 for the new binary.

This solved it for me: updating the sha256 hash in the sudoers file for yabai to match the latest installed binary.

https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#configure-scripting-addition

@b0lle
Copy link

b0lle commented Sep 8, 2023

I am facing the same issue:我面临着同样的问题:

yabai -m space --focus next                                08:48:42
cannot focus space due to an error with the scripting-addition.

Apple Silicon 苹果硅 Ventura 13.5  文图拉13.5 yabai-v5.0.6 (installed from brew) yabai-v5.0.6(从brew安装) SIP status:  SIP 状态:

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: enabled
	Authenticated Root Requirement: enabled

may be you should use yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa" sudo yabai --load-sa

in https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#configure-scripting-addition says

you were right, I missed that section. Thank you!

@CalderWhite
Copy link

Anyone else getting:

$ sudo yabai --install-sa
yabai: '--install-sa' is not a valid option!

@CalderWhite
Copy link

For anyone who comes along, try running sudo yabai --load-sa. For later versions of macOS this should work.

@korsmakolnikov
Copy link

I still have this issue (MAC os 11.7.10) with SIP disabled. sudo yabai --load-sa doesn't fix it.

@milesromeno
Copy link

I encountered this error after running a brew upgrade. Re-checking the output of shasum -a 256 $(which yabai) showed that a new sha256 hash had been generated. Updating /private/etc/sudoers.d/yabai to replace the old sha256 with it fixed this.

@andriibutko
Copy link

I encountered this error after running a brew upgrade. Re-checking the output of shasum -a 256 $(which yabai) showed that a new sha256 hash had been generated. Updating /private/etc/sudoers.d/yabai to replace the old sha256 with it fixed this.

Should this case be also listed in the wiki?

@YinanZhaoXometry
Copy link

I encountered this error after running a brew upgrade. Re-checking the output of shasum -a 256 $(which yabai) showed that a new sha256 hash had been generated. Updating /private/etc/sudoers.d/yabai to replace the old sha256 with it fixed this.

Please add this in wiki, took me hours to find this...

@b0lle
Copy link

b0lle commented May 14, 2024

its mentioned in the shell comments of https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#configure-scripting-addition

#   this hash must be updated manually after upgrading yabai.

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