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

Struggling to get windows focused correctly #2353

Closed
thefiredman opened this issue Jul 17, 2024 · 0 comments
Closed

Struggling to get windows focused correctly #2353

thefiredman opened this issue Jul 17, 2024 · 0 comments

Comments

@thefiredman
Copy link

I am working on the following script:

focus window after active space changes

yabai -m signal --add event=space_changed action="[ $(yabai -m query --windows --space | jq length) -eq 1 ] && yabai -m window --focus first"

I tried writing my own script as #719 (comment) didn't work

This focuses the window if there is only one window present I tested this in /bin/sh and it worked.

Is there something I'm missing help would be appreciated.
I also have this which focuses the window if there is only one. These scripts aren't great but I'm kinda struggling.

yabai -m signal --add event=window_destroyed action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse"
yabai -m signal --add event=application_terminated action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse"
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

1 participant