Improve initial tiling -> floating experience via SUPER + V
Allows for a more predictable behavior when moving a window from tiling to floating with sensible defaults, but is also user configurable via env vars.
Adds:
omarchy-cmd-toggle-floating-windowomarchy-cmd-move-floating-window [left | center | right]
Now, when floating a window, instead of it appearing slightly off screen and 100% requiring mouse interaction to reposition, you can float a window and it will center horizontally taking up 80% of the screen (by default) and will take up 93% of the height (by default). Both values are configurable via env vars if the user wants to override them. This is useful for times when you need to interact with a tiled window in a larger way, but don't want to put it on another workspace. You can now more easily float it centered and pop it back in when you're done.
Additionally pressing SUPER + F11 will pseudo full-screen but float a window at 95% width and 93% height.
- This is a nice modifier to the SHIFT + F11 which is "real" (forced) full screen. and F11 which is default (normal) full screen.
Finally, you can move a floated window left or right by pressing SUPER + F10 (to move left) and SUPER + F12 (to move right). Those take up 60% of the width of the screen, and you can also move to floating left or right directly from tiling mode, you don't have to float first, though you can.
The 93% by the way is just so that with the default border width and waybar height the window isn't overlapping waybar at all.
Here's a short demo.
https://github.com/user-attachments/assets/85711a5e-abc8-49ca-a2f4-69f83acf3eb2
I'm not entirely sure what the actual intentions are, as in:
- why do you want to float the window to begin with?
- isn't just centering it enough?
- why not use the fullscreen toggles to simply view a single window?
I'm asking this, because this PR seems to add quite a bit of complexity for dealing with floating windows, which shouldn't be the intention to begin with, i think.
Good questions @abenz1267
- For me, I usually want to float the window because it's too small in it's current tiled location to see the full context of something I'm trying to do, yet I do still want that window in my current workspace.
- Centering the window instead of the current behavior would be an improvement, IMO, but it still leaves the window too small to work with by default.
- But if going straight to the larger floated centered window at 80% by default is not something that is wanted (perhaps 80% default is too large for desktops), I could either a) make it smaller like 60% by default, or b) leave super + v as is (though yes, centered would be better) and then turn super + f11 into that 80% centered version instead of 95% centered version. I'd be fine with no 95% centered version and at that point just go to full-screen, but this was just sort of a nice "nearly full screen" but you can still see waybar and have the context of the space you're working within. Which is nice, IMO.
- I very much do not like 100% full screen unless the intention is to work inside of that application on a singular task (editing a video, for example), so to me, this floating behavior is more friendly when you just want to better see a message, or reply to a chat or something, or have more room to make copying some text easier without scrolling, etc. True f11 full screen is way too nuclear of an option for a quick task IMO, especially on larger displays.
All that said, if this stays a me-only thing, that's fine. Obviously I can make it work this way on my machine regardless. I just thought this was an objectively better way to have default floating happen when you need it, so I wanted to share.
Isn't all that issues solved by fullscreen,1? f.e. bind = $mainMod,B,fullscreen,1
Nice! I didn't know about fullscreen,1, that is indeed better than my SUPER + F11 and I will update this PR to include that. However, I still think the default toggle from tiling to floating is much better with my modifications. Take this workspace for example
Now look what it does by default when I pop nvim out
Maybe it's just me, but that's totally unusable without mouse interaction. And sure, you could argue that "if you pop out of tiling to floating you are 100% going to use the mouse" but I just disagree with that.
I think centered with some reasonable default width is much more user-friendly when going from tiling->floating.
Just my two cents. Centering the window properly I think is good, setting it to an arbitrary size probably not? I'd rather it stayed whatever size the window was when it was tiled.
That said, if a fixed size is chosen, does this behaviour interfere with using a windowrule to set the size for specific application when floating?
Just fyi. Another community member is working on a similar functionality. Maybe there is some inspiration to gain here (from Discord)
sorry. tagging along to this convo and i dont understand benz comment on how to fullscreen. what is meant by
Isn't all that issues solved by fullscreen,1?
How do I do that?
f.e. bind = $mainMod,B,fullscreen,1
I think we should have this fixed properly in Hyprland directly. When a window is toggled into floating, it shouldn't be off screen. What do you think @vaxerski?
sure https://github.com/hyprwm/Hyprland/issues/12138