-
Notifications
You must be signed in to change notification settings - Fork 50
yabai -m display --focus does not work for the displays with stacks #67
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I encountered this issue too, and disabling Hammerspoon via yabai does not resolve this. |
I have just started with yabai and stackline. So far this is what I've found:
I don't know if there is a way to make hammerspoon run in a daemon mode, or not as a mac app, but that might help. |
Thanks for the report @Fouer . Aha… I never use I will try to reproduce this weekend, and might be able to exclude Hammerspoon from the window filter in Stackline to resolve this. |
Bad news everyone: I don't see a clear path toward fixing this. I can reproduce it when using multiple displays. That said, I don't think I can fix this at the "stackline" level – the issue appears to live at the intersection between Things I tried:
I really appreciate the detail notes @rohni. |
I was able to work around this by sending Hammerspoon below everything else:
but note this makes using the Hammerspoon console difficult as it will appear under every other window. |
@AdamWagner I have also hit this issue. If I remove stackline from |
I think @rohni was on to something. I have hammerspoon disabled in the dock and menu but when focusing a space on first display the focus changes to hammerspoon (which is not open on this space). I set
I have @blefevre's Yabai rule but didn't seem to help. |
I wrote a workaround with @koekeishiya's help. If you focus on window ID and not display you avoid the bug where Stackline steals focus.
|
You can also use this method to stack across displays:
|
None of the solutions from here worked for me, but adding the following to # focus window after active space changes
yabai -m signal --add event=space_changed action="yabai -m window --focus \$(yabai -m query --windows --space | jq .[0].id)"
# focus window after active display changes
yabai -m signal --add event=display_changed action="yabai -m window --focus \$(yabai -m query --windows --space | jq .[0].id)" Source: koekeishiya/yabai#719 (comment) |
So the first index in the array is always the most recent window in in that space? |
@restfuladi It's not explicitly documented but in my limited testing it seems to work. |
@restfuladi I can confirm that my command does not always solve the issue :( |
You can "yabai -m query --spaces --display (direction)" then focus on "first-window" or "last-window". That's what I do and it works well. |
@restfuladi I have two issues when using your approach:
Here is my code # focus window after active space changes
yabai -m signal --add event=space_changed action="yabai -m window --focus \$(yabai -m query --spaces | jq '.[] | select(.\"is-visible\" == true) | .\"first-window\"')"
# focus window after active display changes
yabai -m signal --add event=display_changed action="yabai -m window --focus \$(yabai -m query --spaces | jq '.[] | select(.\"is-visible\" == true) | .\"first-window\"')" |
I built upon @blefevre's solution and I can confirm that everything works perfectly now 👌 yabai -m signal --add event=window_created title="Hammerspoon Console" action="yabai -m window \$(yabai -m query --windows | jq -e '.[] | select(.app==\"Hammerspoon\" and .title==\"Hammerspoon Console\") | .id') --minimize"
yabai -m rule --add app="Hammerspoon" title="" manage=off layer="above" sticky=on Explanations:
If it doesn't work for you, you can alternatively use this solution: yabai -m rule --add title="Hammerspoon Console" manage=off layer="below"
yabai -m rule --add app="Hammerspoon" title="" manage=on layer="above" sticky=on |
Hey guys, just found an annoying issue. Once I create a stack at any monitor, I can no longer focus it with -m display --focus command, focus just disappears. Any solutions?
The text was updated successfully, but these errors were encountered: