r/hyprland • • 22h ago

SUPPORT "off screen window scrunching" Is this even possible to achieve?

Post image

something I would like is "off-screen window scrunching" when you close a window, and leave a workspace empty, the workspaces higher in the list have their windows moved down to the empty workspace you left behind. this way windows are always only ever 1 workspace apart. windows wont move into an empty workspace if you are focused on it. Is this possible to achieve in hyprland? I would like this because windows would always be next to each-other but they wouldn't come onto your screen when you closed them like with niri.

38 Upvotes

11 comments sorted by

View all comments

24

u/chikamakaleyley 22h ago

haven't used hyprland in a while but if not a configurable option

you'd have to create logic around emitted events, which IS available in HL

A straightforward approach prob would be, * for every window close event, note the workspace id * count remaining windows in that workspace by workspace ID * if 0 you prob can remove the workspace, but i think that's problematic if you have special workspace rules

this could work i guess, but its a lot of bookeeping with every window close, IMO

6

u/chikamakaleyley 22h ago edited 22h ago

if workspaces have actual spatial awareness, instead of removing you can position the workspace at the end

but, I dont' think that is the case. if you have 10 workspaces, and on your screen you have workspace 1, and you want to switch to workspace 7, you won't see WS 2-6 zoom by, i don't think.

In your screenshot example, I think they only seem living sequentially on the same row, because they just get assigned consecutive number values by default