Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature request: another option to split containers #3238
A container can be set to either split horizontally or vertically. I'm suggesting a third option that would split a container depending on it's proportions.
If the container is wider than tall -> split horizontally
I think it would be much easier and faster to get a nice layout this way. Imagine what happens when you have a 16:9 screen and open four windows. If the screen is set to split horizontally you get four thin windows side by side, each taking up 1/4 of the screen. If the screen is set to split by proportion you get one window taking up 1/2 of the screen, one window with 1/4, and two with 1/8.
Also, each time you open a new window, only one other window has to be resized to make room. That helps with keeping the windows you already have open at the right size.
As far as I can tell it's not that easy. You have to use
You can automate that if you only open and close windows with keybindings from your i3 config file, but that breaks down if you also open or close windows in other ways. For example by starting a browser window from a terminal, or closing the last browser tab with ctrl+w instead of $mod+Shift+q.
Workspaces kinda have that behavior already. See "4.8. Orientation for new workspaces".
After tinkering with my configuration for a while I just realised, my description wasn't very good. I was thinking about a container that in some cases doesn't exist yet. Let me try again.
The split direction of a workspace already gets set accordingly to it's proportions. That means, if you have only one window on a workspace, the first split will half that window and put the new window on the right (wide workspace) or on the bottom (tall workspace). I'm suggesting an option to make that behavior recursive.
I think it's visually more intuitive than the approach to squish everything in the current container and put the new window at the end.
Here is how I think it could work. Keep in mind, I have not looked at the source code yet.
Lets call it split-recursive.
This would require us to constantly create new containers on our own. I'm not a fan of that idea, it's not something we really do or want to do.
What about https://github.com/olemartinorg/i3-alternating-layout? That seems to do exactly what you want, no?