-
Notifications
You must be signed in to change notification settings - Fork 219
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 use custom script to move focus #139
Comments
It's the same behaviour as in this issue: skhd works correctly when run from shell but not when started with |
So first, if you want to debug a shell script, run Second, I think the issue is even before your script runs. It is likely that the launch agent that |
Thanks! Is there an obvious place to look for the logs?
I was able to diagnose the issue using less sophisticated means. It turns out that if I define a function in the script and call it, using |
After upgrading to Big Sur, Having tried to debug, I couldn't figure out the root cause here. My workaround was to start # Load Script Additions for BigSur, as per instructions:
# https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)/c16d7804fc1093129516acedd507b5f838d34192#macos-big-sur---automatically-load-scripting-addition-on-startup
sudo yabai --load-sa
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
# Start SKHD in the background. Work around issues:
# https://github.com/koekeishiya/skhd/issues/103
# https://github.com/koekeishiya/skhd/issues/139
skhd & I don't like this solution much because it might leave the |
thanks to @aSapien for this hacky solution, but if you are still having problems loading your configs from your dotfiles, try putting this in your # Start SKHD in the background. Work around issues:
# https://github.com/koekeishiya/skhd/issues/103
# https://github.com/koekeishiya/skhd/issues/139
# thanks to @aSapien!!!
skhd -c $HOME/.config/skhd/skhdrc this should specify the config and load properly on loading yabai, but still has the same issues mentioned by aSapien. i personally have this at the end of my |
I've been struggling with this issue and I believe I've found the root cause and a workaround. TL;DRWhen The fix: > # Make a copy of the default service.
$ cp ~/Library/LaunchAgents/homebrew.mxcl.skhd.plist ~/.config/skhd/
> # Add /usr/local/bin: to the service file.
> # Note: This probably only works if you have a M1 chip b/c homebrew installs to /opt/homebrew for M1 only (i think).
> # Either way, it's probably easier to just edit this file by hand vs using my sed command.
$ sed -i '' 's/\/opt\/homebrew\/bin:/\/usr\/local\/bin:&/' ~/.config/skhd/homebrew.mxcl.skhd.plist
> # Start skhd using the new service file.
$ brew services stop skhd
$ brew services start skhd --file=~/.config/skhd/homebrew.mxcl.skhd.plist Longer versionI've been struggling with this for a few hours. Tricks like symlinking Stopping skhd ( I checked yabai's error logs - For whatever reason the environment homebrew was running things in was different from my path. I tried a bunch of things like creating a I ran I edited the file to add the More exploring and I where this file was getting created. > # Turn on developer mode
$ brew developer on
> # Edit the skhd "homebrew formula"
$ brew edit skhd I could see where it's redefining this file, overriding my path changes. I could edit this but that would be helpful for dotfiles or anything. Long term fixCould whatever is populating this |
koekeishiya/yabai#526 (comment) solves window move focus across screens without script. In case anybody ends up here from google like me ;-). |
I wrote a script to control yabai that either moves focus west or, if there's no window available on that display, selects the closest window on the closest adjacent display. It works well when run from the shell (as
$SHELL -c '"${HOME}"/.config/skhd/yabai-locator window focus west'
) but the keybind doesn't do anything.Can anyone see what's going wrong? I don't know how to debug what's happening but would be happy to with some direction.
Thanks!
in
skhdrc
:yabai-locator
: gistEdit: I tried inserting
echo [cmd] >> temp_file
at various points and the problem is in calling functions internal to the script, eg$(exists_window_to_left_of_focus)
on line 114. They don't return anything.The text was updated successfully, but these errors were encountered: