-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
Question: Can I make all non-resizeable windows float (preference windows, autosuggestion windows etc)? #1317
Comments
I'm still new, but something I noticed here is that Maybe you could try to query |
You can do this using signals, isn't perfect but works. Maybe this comment can help: |
Ideally signals should be allowed to run and override certain parts of yabai's event handler logic. That would in theory make it possible to run a signal on window_created and make the window float without having it first be tiled, avoiding a change in dimensions and the visual flicker. |
Thanks for the input! Yeah, you are totally right. Unfortunately it seems like there is no valid argument that I can use when I query the windows. It seems like using signals might do the trick! |
Wow! That seems to be exactly what I am looking for! Thanks a lot for finding it. Unfortunately it does not seem to work for me when I add the signal which seem to work for them. As I said in the opening post – this is not a big deal as I love how Yabai works as is. But it would be nice if it worked. I have tried the following (between each step I restarted the yabai service):
This is now my .yabairc file:
When I query the windows I get the following for the Calendar-window and the Calendar settings-window:
|
The property name is |
I see! Thanks a lot for pointing it out! Maybe this was changed in yabai since they (here) wrote that signal. When I write the following command in my terminal (I am a complete noob to scripting) it seems to check if the current active window (the terminal window) is
And when I run the following command with the same active window (the terminal window) it doesnt make it float which makes me believe it works as I intend.
But when I use this signal it doesnt seem to work. I probably have a typing error or missunderstood something:
I also tried to escape the
I need to go to bed now but I will continue to experiment with this tomorrow! :) |
How about:
Btw, since you have your yabairc with So, maybe a solution would be to not have |
@carlos-gtz: you forgot to pass |
Thanks, adding that up to my answer :) |
I really appreciate all the help! :)
Wouldn't I need to check if
But it doesn't seem to do anything unfortunately. I also tried to check if
But no luck. I tried changing some here and there but I can't seem to get the signals to work. Maybe my scripting-addition is not loaded correctly.
Love this idea! I tried and commented out the layout bsp in my yabairc. Then I reloaded yabai (which I always do inbetween changes). All windows are now floating (which is intended). Then I wrote the following command in my terminal just to try it out:
But the terminal window stay float somehow. I guess I do quite many obvious mistakes when I try stuff :D Right now I am thinking of leaving it be, because it is not that annoying that very few windows that cannot resize "tries" to take up half of the screen. |
It works for me when I do it on the terminal 🤔 My terminal is float, then I do this to tile it. If the window can't be resized, then I do this: Here is one trick for you to try this without using signals. You can sleep the command before execute it.
How about you comment all your current rules and signals? Then try this and see if it works. |
You need to escape the |
Thanks for the tips. This works nicely for me:
Edit^: Blindly toggling it was undoing my Note that It would be great if we could have floating turned on by default and have the reversed rule to avoid flickering etc, but I couldn't get that to work - it doesn't seem to be supported at the moment. |
How can I avoid that the new window jumps to the parent window instead of staying in the middle of the screen? @XA21X |
I have added some changes to your command @XA21X which make it on the top layer and centred in the screen:
|
I have some changes for above command
systemApp='^(System Preferences|System Information|Finder|Calendar|Mail|App Store|Activity Monitor|Dictionary)$'
manageOffApp='^(IINA|Stats|LICEcap)$'
yabai -m rule --add app="${systemApp}|${manageOffApp}" manage=off
yabai -m signal --add event=window_created \
action='yabai -m query --windows --window $YABAI_WINDOW_ID \
| jq -er ".\"can-resize\" or .\"is-floating\"" || \
yabai -m window $YABAI_WINDOW_ID --toggle float' \
app!="${systemApp}|${manageOffApp}"
alt + ctrl - i : json_text=$(yabai -m query --windows --window mouse | jq -r tostring | tr -d '{}"' | tr ',' '\n') ; \
appName=$(echo "$json_text" | sed -n 's/^app:\(.*\)/\1/p') ; \
result=$(osascript -e "display dialog \"$json_text\" buttons {\"Close\", \"manageOff\"} default button \"Close\"") ; \
echo "$result" | grep -q "manageOff" && \
perl -i -pe "s/manageOffApp\=\'\^\(/manageOffApp\=\'\^\($appName\|/g" ~/.config/yabai/yabairc && \
yabai --restart-service |
Doesn't seem like this is possible, since the signal is executed after the windows is spawned. Unless anyone else has figured out a better way. |
child windows all have 'can resize' set to true in yabai. |
@jqtmviyu can you elaborate more on why you approached it this way? |
@kabeersvohra That's lovely! 😍 The only part which doesn't seem to work is the centering. For me the window always appears in the bottom left edge... 🤔 |
Had the same issue. For now I somewhat solved it with putting it into a single command. Getting a little flickering, though.
|
@benvp Thanks for that snippet! Do you by any chance know how I'd add manual exceptions to this? One of my programs is identified was not resizable, due to it doing some hacky workarounds, even though it can be resized just fine. |
I'm not experienced with I'd filter out the apps by checking the app or title field and exclude them.
This would be the final snippet. Didn't test it, but maybe it points into the right direction.
|
I have searched a lot for this but can't find any real answer to how to do this. I'm a bit new to this – sorry if this is a noob question with obvious answer. I really like Yabai so far and this is absolutely not a big issue for me.
For some small non-resizable windows it seems to work that they become float but some are not.
Example
When I have a finder window and calendar window open – then the both window share the space which is great.
But if I for example open the finder preferences window – then the preferences window is not floating which results in the calendar window is pushed down and a lot of space is unused plus that the layout becomes "broken".
My try to resolve this
I use the finder preferences window as an example here but this happens to some other small windows (for example the autosuggestion box inside calendar app or the finder file transfer window).
I have tried writing this code in the yabairc but it dont seem to work:
yabai -m rule --add can-resize="^false$" manage=off
This is my yabairc
Do I need to have the SIP disabled and scripting-addition loaded?
Does anyone know a way to do this? Thanks!
If there is no way to do this to all windows then it is fine. Yabai seems really great and I love how powerful it seems to be!
The text was updated successfully, but these errors were encountered: