How do I stack two selected window out of 4 windows?
Let's say I have 4 windows side by side. How do I group them into 2 groups and stack each of them?
Let's say I have 4 windows side by side. How do I group them into 2 groups and stack each of them?
Let say, you have 4 windows in a horizontally split container, looking like this:
+-1--+-2--+-3--+-4--+
| | | | |
| | | | |
+----+----+----+----+
And you want to order them into two tabbed containers inside a horizontally split container, looking like this:
+-1-------+-3-------+
+-2-------+-4-------+
| | |
+---------+---------+
One way to do this is:
Focus window "1" and run the following i3 command (here with i3-msg
, but it could be bound to a key):
i3-msg 'split vertical, focus right, move left, layout stacking, focus right, split vertical, focus right, move left, layout stacking'
Explanation:
split vertical
or split horizontal
: creates a split container in place of window "1" with window "1" in it. (Which split does not matter as the layout will be changed in the next step)layout stacking
: switch layout of the new container to stackingfocus right
: focuses window "2"move left
: moves window "2" into the stacking containerfocus right
: focuses window "3"split vertical
or split horizontal
: same as step 2.layout stacking
: same as step 3.focus right
: focuses window "4"move left
: moves window "4" into the same stacked container as window "3"As no window is moved outside of the original split container, this should work reliably even if this container is surrounded by other containers.
If these are the only four windows on a workspace, this would be shorter:
layout stacking
move left
layout stacking
focus right
:should focus window "2"move left
Generally speaking, to get a certain layout do the following:
layout <splith|splitv|tabbed|stacking>
)split vertical
or split horizontal
on one window you want to have in this sub-container. This creates a container with the window in it.(Step 1. and 2. are interchangeable)
In some cases there may be shorter ways, but the above should work everytime.
Asked: 2014-12-01 06:20:51 +0000
Seen: 526 times
Last updated: Dec 01 '14