Skip to content

Conversation

@schuyler1d
Copy link

While focus-window-next and -prev cycle through windows by-keyboard, this adds two customizable additional configurable shortcuts that will switch the focus window's position/size with the next window. This allows, with a single keyboard-chord to e.g. swap a bigger window area with a smaller window area and then back and forth to manage which one has more attention.

Besides adding the slots/api-calls, this moves some of the logic that was used in _onKeyboardFocusWin to an abstracted function that can also be used for the swap/shift events. Most of that method avoids behavior changes, however one part does not out of necessity -- workspace.list_windows() does not have a stable ordering, so we sort here roughly by-clockface -- so people's experience may shift subtly for focus-window-next -- however, I would argue that this is mostly a 'feature-not-a-bug' as the window ordering becomes a bit more intuitive (if not immediately, then when you get used to it)

Some added context: I'm an XMonad refugee and interested in adding some of the features/behavior that XMonad offered -- instead of a 'directional' shifting/movement, it 'cycled' through window positions a bit more. This is my first contribution. Eventually I'd also like to add some keyboard shortcuts for resizing the focus window by-keyboard, though it looked like with the upcoming layout changes, I didn't want to add complexity/conflicts with upcoming changes (without feedback).

@domferr
Copy link
Owner

domferr commented Oct 4, 2025

Hey thank you for this pull request, it is very interesting! Can you share a video?
I was curious to also add animations, I mean to see the windows move to their new positions. There is an utility method I made which will make it easy to do, but I'm curious to see how it is without any animation before 😃

@domferr domferr changed the base branch from main to v17.1 October 4, 2025 15:02
@domferr
Copy link
Owner

domferr commented Oct 4, 2025

Changed the base branch to v17.1, to aim to get this pull request in the next release

@schuyler1d
Copy link
Author

Here's a video (i think!)
Screencast from 2025-10-05 16-42-42.webm

@schuyler1d
Copy link
Author

I'm game to add animations (with your guidance)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants