Cannot use custom script to move focus
- Dominant language
- C
- Stars
- 8.1k
- Forks
- 241
- PR merge metrics
- No merged PRs in 30d
Description
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`:
```
cmd - h : "${HOME}"/.config/skhd/yabai-locator window focus west
```
`yabai-locator`: [gist](https://gist.github.com/d-miketa/7017d9539e43b303220943e605c03c19)
Edit: 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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the skhdrc binding and compare its execution with the shell command shown in the issue. Inspect the yabai-locator gist, especially the function call around line 114 and the reported missing return values. Done means the custom binding invokes the script successfully and the focus command behaves as it does from the shell.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100