The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
1

How can I get two stacked containers side-by-side?

asked 2014-12-15 18:33:35 +0000

jon.reeve gravatar image

I can make my whole screen stacked, and then I can move windows out of that stacked container, but I can't seem to make more than one container stacked on my screen. In other words, what I'd like to do is this:

|--Win A1--||--Win B1--|
|--Win A2--||--Win B2--|
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-12-15 20:21:48 +0000

Adaephon gravatar image

If you generally prefer stacked containers, I would suggest setting

workspace_layout stacking

in your i3 configuration. That way you start out with a stacked container and when you move a window out of it is again put into a new stacked container.

So, if you just open four windows, you will get

+-Win 1-------------------+
+-Win 2-------------------+
+-Win 3-------------------+
+-Win 4-------------------+
|                         |
|                         |
+-------------------------+

If you then move "Win 3" to the right, you get

+-Win 1------+-Win 3------+
+-Win 2------+            |
+-Win 4------+            |
|            |            |
|            |            |
|            |            |
+------------+------------+

And moving "Win 1" to the right after that will have the desired stacked containers side by side:

+-Win 2------+-Win 3------+
+-Win 4------+-Win 1------+
|            |            |
|            |            |
|            |            |
|            |            |
+------------+------------+

If you want to stay with some other default_orientation, you still can create a side-by-side layout of stacked containers by manually creating containers and switching them to stacked layout.

Lets say, you again start out with the following layout:

+-Win 1-------------------+
+-Win 2-------------------+
+-Win 3-------------------+
+-Win 4-------------------+
|                         |
|                         |
+-------------------------+

If you did not set workspace_layout or set it explicitly to default, moving "Win 3" and than "Win 1" to the right will probably get you the following layout (depending on screen orientation and setting of default_orientation):

+-Win 2--+-Win 1--+-Win 3-+
+-Win 4--+        |       |
|        |        |       |
|        |        |       |
|        |        |       |
|        |        |       |
+--------+--------+-------+

That is because moving out "Win 3" did not create a new container, it instead moved "Win 3", and than "Win 1" into the same horizontal split container the initial stacked container resides in.

To avoid this, you need to explicitly create a stacked container around "Win 3" after moving it out. There is no command to do that directly, but it takes only two steps:

  1. Create a container around the current window with either of the commands split horizontal or split vertical. This will put the current window into a new split container with the window as its only member. (Any new window or window moved into that container would then be sorted next to the initial window inside this container)
  2. Switch the layout of this container to stacking with the command layout stacking.

Making use of i3's ability to chain commands, you can just bind split vertical, layout stacking to a key in order to run both commands with one keypress.

So, after moving "Win 3" out:

+-Win 1------+-Win 3------+
+-Win 2------+            |
+-Win 4------+            |
|            |            |
|            |            |
|            |            |
+------------+------------+

run split horizontal, layout stacking, than move "Win 1" to the right and you will get the desired result:

+-Win 2------+-Win 3------+
+-Win 4------+-Win 1------+
|            |            |
|            |            |
|            |            |
|            |            |
+------------+------------+
edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-12-15 18:33:35 +0000

Seen: 341 times

Last updated: Dec 15 '14