The i3 FAQ has migrated to https://www.reddit.com/r/i3wm/. All content here is read-only.
Ask Your Question
1

Window layout - vertical plus horizontal containers

asked 2015-04-09 23:15:48 +0000

savanna_cat gravatar image

updated 2015-04-10 06:18:54 +0000

(Been using i3wm for a 18 months now, love it. I've looked at FAQ Move Window within Container).

Let's say I've got 3 windows, (A, B, and C), laid out like this:

-------------
|   |   |   |
| A | B | C |
|   |   |   |
-------------

I want to change the layout to the following, how do I do it?

------------
|      | B |
|  A   |---|
|      | C |
------------

I know from user guide that the windows are in a tree, I'm trying to work out the key combinations to do the above.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
3

answered 2015-04-10 02:50:00 +0000

i3convert gravatar image

updated 2015-04-10 04:20:00 +0000

The exact keys you would use depend on your configuration. I'll use this config file: http://i3wm.org/docs/user-contributed... for reference and list the corresponding i3 commands. The modifier key $mod is most likely Alt or the Windows key on your computer.

  1. If the window B is not focused, focus it via either $mod+Left or $mod+Right (command focus left or focus right).
  2. Split the window in the vertical direction: $mod+v (command split v). There may be little or no visible difference (perhaps the bottom edge becomes visibly active).
  3. Move focus right, to the window C, using $mod+Right (command focus right).
  4. Move the window C to the left, using $mod+Shift+Left (move left). It should now be in the same column as the window B.
edit flag offensive delete link more

Comments

thanks @i3convert, this worked nicely!

savanna_cat gravatar imagesavanna_cat ( 2015-04-10 06:13:09 +0000 )edit
2

answered 2015-04-10 10:42:58 +0000

Adaephon gravatar image

One way to do this is:

  1. Focus window A (focus left, once or twice)
  2. Change layout to vertical split (layout splitv)
  3. Move window A to the left (move left)

Unless you resize a window or container, all windows or subcontainers in a container have the same size. So, iff you want the sizes from your example, you need to resize the containers (resize grow width 10 px or 16 ppt or use the mouse; Note: the px value will be ignored for tiled windows)

Explanation:

Initially all three windows are in the same container.

|
+-A
|
+-B
|
+-C

The desired result has A next to a (sub)container which contains B and C

|
+-A
|
+-+-B
  |
  +-C

There are essentially two ways to achieve this:

  1. create the subcontainer by running split v (or split h) on either window B or C. Then move the respective other window into this container (which is what i3convert's answer does)
  2. or create a supercontainer by moving A out of the existing container

    As the initial container was the top-level container of the workspace i3 creates a new (super)container which then contains window A and the initial container with windows B and C.

edit flag offensive delete link more

Comments

Thanks @Adaephon!

savanna_cat gravatar imagesavanna_cat ( 2015-04-10 22:22:40 +0000 )edit

Question Tools

Stats

Asked: 2015-04-09 23:15:48 +0000

Seen: 246 times

Last updated: Apr 10