hyprland-plugins icon indicating copy to clipboard operation
hyprland-plugins copied to clipboard

hyprscrolling: better automatic and manual column management

Open noctuid opened this issue 7 months ago • 5 comments

It would be good if it was possible to have windows always open in their own new column and automatically scroll right.

Right now it looks like you have to use move +<num> to manually scroll to be able create more columns. In e.g. Niri and scroll/hyprscroller, scrolling is automatic by default. The way I'd expect it to work is that new windows always open to the right/in a new column (this is horizontal mode in scroll or niri). If the default width is 0.5, with 2 windows open, opening a third would push the leftmost out of view. The 2nd window would be the left half of the screen and the 3rd window would be the right half. Opening windows/moving focus will always automatically make sure the selected window is in view. So if after opening that 3rd window, you then ran movefocus l twice, it would push the 3rd window off screen to the right.

There are a lot of commands that would be useful to have, but I think these are the most basic/immediately useful ones:

  • an equivalent of movefocus left/right/up/down that always wraps within the column (for up/down) or within the row/workspace (for left/right) instead of moving to another monitor/output in that direction (if there was only 1 window, I'd expect it to do nothing)
    • this would be useful even for normal layouts I think; I couldn't find a way to do this but may have missed something
    • also would want the same functionality optionally for movewindowto layout message
  • a layout message to set the width of all columns on the current workspace (e.g. colresizeall)
  • a layout message to switch between configured preset widths for the current column (e.g. [0.333... 0.5 0.667 1])

Having multiple windows in a column right now is also wonky, but I'll think about that more and open a separate issue.

@definitelynotrazu I think this is what you were talking about making an issue about in the other issue, feel free to add anything

noctuid avatar May 18 '25 18:05 noctuid

thanks! This helps a lot because as I've said a few times, I don't use this layout so I don't know what is needed :P

vaxerski avatar May 18 '25 18:05 vaxerski

a layout message to set the width of all columns on the current workspace (e.g. colresizeall)

All as in all all, or all that are visible?

vaxerski avatar May 18 '25 18:05 vaxerski

Personally I'd want it for all or maybe a specific number of windows (e.g. so I could give 3 windows each 0.333 or 2 windows 0.5.). That kind of gets into fitting.

For fitting, scroll also has a somewhat related command fit_size with different options:

  • active - maximize/give the active column width 1.0
  • visible - fit all (even partially) visible columns within the screen
  • all - fit all columns in the row on the screen
  • toend - fit columns from the current to the end of the row/workspace
  • tobeg - same but to the beginning of the row

And then it takes another argument proportional or equal. Equal would make them all the same width. proportional would do it proportionally to their previous widths.

I don't personally need something that complicated. I'd just want to be able to fit a specific # of columns on the screen, and then I would probably just manually resize them if I didn't want them equal widths.

noctuid avatar May 18 '25 19:05 noctuid

last point done with above.

vaxerski avatar May 18 '25 19:05 vaxerski

@definitelynotrazu I think this is what you were talking about making an issue about in the other issue, feel free to add anything

Yes this is more or less what I had in mind. Thanks for writing out the issue.

definitelynotrazu avatar May 18 '25 22:05 definitelynotrazu

Instead of creating a new issue: the one thing missing on top of this is aligning a window to center: alignwindow m. I am coming from hyprscroller and this was my resize submap:

      submap=resize
      <truncated normal resize binds>
      binde=,t,scroller:fitsize, active
      binde=,a,scroller:fitsize, all
      binde=,b,scroller:fitsize, tobeg
      binde=,e,scroller:fitsize, toend
      binde=,v,scroller:fitsize, visible
      binde=,m,scroller:alignwindow, m
      binde=,space,scroller:cyclewidth, next
      binde=SHIFT,space,scroller:cycleheight, next
      bind=,return,submap,reset
      bind=,escape,submap,reset
      submap=reset

Out of these I most use the alignwindow to center (m), since on wider monitors this is REALLY important for me. The other often used keybinds (already mentioned) are resizing the active window to fit the whole screen (this is by far the most common fitting i am using), and the cyclers (which seem to be implemented now 🎉 ).

clotodex avatar May 22 '25 06:05 clotodex

Added the fit layoutmsg

vaxerski avatar May 22 '25 13:05 vaxerski

Out of these I most use the alignwindow to center (m)

You mean "when I execute this, the current focused window is moved to the center"?

vaxerski avatar May 22 '25 13:05 vaxerski

wrapping focus added with focus layoutmsg.

vaxerski avatar May 22 '25 13:05 vaxerski

colresize all added.

vaxerski avatar May 22 '25 13:05 vaxerski

ah, sure, I can add that.e

vaxerski avatar May 22 '25 14:05 vaxerski

wrapping focus added with focus layoutmsg.

Thanks! For the focus command, does it align the window in the center? It would be good if it didn't center align and that was only handled with a separate align command or as shown by @maotseantonio where it will automatically left or right align depending on the direction you are moving.

I don't think it's needed initially, but scroll's alignment is more complex in that it will depend on what can fit in the view. Scroll describes it this way: "Columns are generally aligned in automatic mode, always making the active one visible, and trying to make at least the previously focused one visible too if it fits the viewport, if not, the one adjacent on the other side" (if it fits). Not sure what niri does in that edge case , but maybe there could eventually be different align modes.

noctuid avatar May 22 '25 14:05 noctuid

Alright I finally got around installing and testing it. @vaxerski I think I get what you did, let me try and summarize and give (opinionated) feedback

focus

hyprlands focus does not move "out of screen" -> so you built the focus layoutmsg instead - direct dropin for default focusing. -> instead of building a dedicated "align (center|left|right|..)" the default behavior of the focus is to align center (which I actually kinda like) - I am fine with this but differs from what scrolling people (niri, hyprscroller, ...) might be used to

There is a bug though, the cursor focus moves AHEAD of the window focus (interestingly corrects itsself when I get a notifiction O.o)

Image

move

I dont get what this does, that focus does not do - like you can move to a "blank" column i guess, but this feels more like an underlying dynamic than something I would use

colresize

Works as intended I think - thank you!

fit

Also works as intended - thank you! (There are a lot of preferences on how people like it in detail - but to get going this looks fine to me)

movewindowto

Again a replacement to the internal movewindow - since you otherwise cannot "move out of the screen". This seems to NOT trigger a focus though, when moving the window out of the screen, which is really weird... (focus should follow the window you are actively moving)

window spawn behavior

A new window should really spawn in a new column. At least for now. Later there is admitting & expelling as well as hyprscroller had column vs row mode as to where the new window is spawned.

Columns height

I could not yet figure out how to go "out of screen" vertically - this might not yet be implemented but is a core idea behind the columns, so that you dont have the window shrinking of any other layout.

In my opinion, the bug in focus (and moving the window out of screen) are the most important thing for it to be usable for me, then the spawning of a new application should be by default in a new column to the right. After that I am happy to already switch fully from hyprscroller and go more into feature requests here. So far my opinion.

clotodex avatar May 23 '25 15:05 clotodex

the default behavior of the focus is to align center (which I actually kinda like) - I am fine with this but differs from what scrolling people (niri, hyprscroller, ...) might be used to

I think the default should try to show full windows or at least partial windows when possible instead of empty space.

I dont get what this does, that focus does not do

Maybe useful for mouse or touchpad?

I could not yet figure out how to go "out of screen" vertically - this might not yet be implemented but is a core idea behind the columns, so that you dont have the window shrinking of any other layout.

Only in hyprscroller/scroll. I prefer the current behavior (auto size to equal space), which matches Niri. It should at least be kept as an option. In some cases I would want a column to be grouped (#350). Rarely I would want to manually resize the windows, but the current behavior is a more useful default I think. In scroll it's wonky that windows can cover up your panel, and even if that wasn't the case, I don't fully understand the use case for wanting scrolling both vertically and horizontally simultaneously.

the spawning of a new application should be by default in a new column to the right.

I think focus working well and this is the main thing for it to be initially usable.

noctuid avatar May 23 '25 16:05 noctuid

thanks for the input. Been kinda busy today, I'll try to implement at least a part of these suggestions tomorrow.

vaxerski avatar May 23 '25 21:05 vaxerski

focus issue was a simple fix, see #358

clotodex avatar May 24 '25 08:05 clotodex

done. Enjoy. Also added promote.

vaxerski avatar May 24 '25 12:05 vaxerski

Looking at it I think all of the originally mentioned points in this issue are now done, right @noctuid ? (and with this also #352

A few new avenues to go down:

  • center_col seems to not be the "usual" scroller behavior, or should at least be configurable

    @noctuid: I think the default should try to show full windows or at least partial windows when possible instead of empty space.

  • this would then coincide with an "allign" command or similar that can align your focused window left, center, or right (up, center, down)
  • touchpad gestures (i am missing them :D) but these might be something to hack together manually with hyprgrass (never used this yet)
  • some expo/overview like feature - I have not used niri, but hyprscroller had a really nice feature that "zoomed out" and gave an easy motion on all windows. This is great for wildly jumping around (hence it being called "jump"). What do you think @noctuid? This is a bit of an issue, since the normal hyprexpo, hyprspace, easymotion, etc dont really work with this. Looking at it, I REALLY like how niri implemented the overview (https://github.com/YaLTeR/niri/releases/tag/v25.05)
  • the autogroup tab option to have a column be "full height" - agree with @noctuid -> #350 (this also makes overviews a lot easier)
  • viewport following movewindowto (~~can create a pull request~~ #359 )
  • focus viewport when window gets focused by cursor
  • colresize fix (also just recalculates missing i think .. yes -> #360 )
  • edit: as below: The scrolling/alignment is not really automatic, so I think either that needs to change or there need to be more dedicated commands that also realign. Only focus scrolls/aligns right now, so e.g. killactive, focusurgentorlast, movewindowto will not scroll.

clotodex avatar May 24 '25 15:05 clotodex

Looking at it I think all of the originally mentioned points in this issue are now done, right @noctuid ?

The scrolling/alignment is not really automatic, so I think either that needs to change or there need to be more dedicated commands that also realign. Only focus scrolls/aligns right now, so e.g. killactive, focusurgentorlast, movewindowto will not scroll. Not sure if that's the same issue your movewindowto PR addresses or another one. Movewindow/movewindowto d in a column also unexpectedly move the window all the way down to the bottom .

Running killactive then focus r seems to work but is a little awkward. Not sure what happens on promote, it seems bugged to me like colresize and doesn't happen immediately.

I think everything else can be opened as separate issues to be less confusing. Overview could be nice as long as you can select windows with a keyboard like in scroll/hyprscroller.

noctuid avatar May 24 '25 15:05 noctuid

With the addition of follow_focus I believe automatic column management (at least as I originally wanted) is fully functional. E.g. closing windows, killactive, moving windows, etc. properly scrolls/aligns now. Certainly enough to fit my daily use cases nicely. Are any edge cases remaining or can this issue be closed?

Also for the other suggestions like overview, I agree with noctuid that they should be split into separate issues to be properly discussed without confusion.

definitelynotrazu avatar Jul 22 '25 22:07 definitelynotrazu

Fwiw @vaxerski , I agree with @definitelynotrazu that this issue could probably be closed as done, and any additional work tracked via new/separate issues.

As a new user wandering into github to see "is there an issue already tracking my ask?" it's hard to decipher in this issue what is/is not already covered/completed/etc., and naively seems like most of this is completed--which is great!

Really loving the scrolling layout. 💯

stephenh avatar Sep 11 '25 17:09 stephenh

It wasn't working when I tested before but after updating today, it looks like things are working.

noctuid avatar Sep 11 '25 22:09 noctuid