dawsers / hyprscroller

Hyprland layout plugin providing a scrolling layout like PaperWM
MIT License
159 stars 9 forks source link

Feature request: add "resize to fit monitor" dispatcher #1

Closed aacebedo closed 6 months ago

aacebedo commented 6 months ago

First thanks for this plugin it is very interesting.

I would like to ask if there is a way to add a dispatcher that would resize the windows displayed in the current screen to make them fit in it (even if a window is only partly displayed on it. It may also have to align first border rf the most-left windows with the left border of the screen.

It could also respect the width ratio of the windows and will enable fast manipulation and alignement of multiple columns.

What do you think?

dawsers commented 6 months ago

I could add something like that. The main idea of using 1/3 1/2 and 2/3 sizes is to be able to fit 2 or 3 windows in the monitor without much hassle, and still have control of the widths. Then there is resizing, which gives full flexibility, but may be slower than what would be optimal. What you are proposing is a good idea if you have an extra-wide monitor and the best ratio is not 1/3. Adding more ratios would clutter the workflow by cycling through them all the time when you want to change width, so I think you are right. I am running out of sensible key bindings, though! :-)

I will see what I can do as soon as I finish the migration to 0.37.1

Thanks for the idea!

aacebedo commented 6 months ago

Thanks for your quick response !

For the migration basically you have to change a few SConfigValues to CConfigValues and use the template to get the value instead of intValue.

You also have to ifdef the include of Workspace.h as it has disappeared.

I have a super ultra-wide screen (32:9 ratio) so I am able to fit 4 to 5 columns usually. Reason why if I had a dispatcher that can quickly resize the windows displayed currently visible it would be of great use. For the size cycling I agree with you that the current setting is good. You could also think of a way to make the ratios configurable though.

dawsers commented 6 months ago

The main problem I have with updating is the build system. There were several conflicts when trying to build Hyprland in a system with an older version installed system-wide, even when using Cmake prefixes. Some of these have been fixed, but I need to rewrite my build scripts, and I am in the process of doing that. The changes to the layout code are simple, like you said. Thanks!

aacebedo commented 6 months ago

I am on NixOS so I do not have those kind of problem for system wide stuff :)

dawsers commented 6 months ago

I added scroller:fitwidth. I hope that is what you expected. It allows you to fit a combination of columns into the visible screen. Let me know if that is what you wanted, and if so, please close the issue. Thank you for the idea, I like it.

aacebedo commented 6 months ago

Seems to work, great implementation thanks !