i3


simple window layout management in i3 tiling window manager


I have a simple i3 question that I just can't seem to figure out.
Let's say I have a blank workspace, and I create 3 terminals. (mod-enter, mod-enter, mod-enter). I want the second and third window to be in their own container, taking half the space of the screen, and tabbed. The first window can remain full sized. (For bonus points, commands for 4 windows - 2 tabbed left, 2 tabbed right would be great!)
That's it - for some reason, I'm not getting the zen of moving windows up and down in the workspace.
(Side note: Is the "Show an image of the current workspace windows" command/programe from this screencast: https://www.youtube.com/watch?v=AWA8Pl57UBY available anywhere? That might help quite a bit, and might help others staring up the slope of this learning curve...)
If there are other completely basic tutorials on i3 layout management that I've missed somewhere, pointers would be very much appreciated.
Thanks so much in advance!
Just the answer
Assuming 3 windows with the rightmost focused, the short answer is (default bindings in parentheses):
split toggle, split horizontal or split vertical (e.g. $mod+v)
layout tabbed ($mod+w)
focus left ($mod+j)
move right ($mod+Shift+;)
For bonus, again with focus on the rightmost window:
layout tabbed
move right
layout tabbed
focus left
move right
Commands for layout management
The main keys to layout management are the two commands layout and split.
layout is used to change the layout of the current, existing container. It has several options only 3 of which are bound to keys in the default configuration:
# tabbed layout ($mod+w in default config)
layout tabbed
# stacked layout ($mod+s)
layout stacking
# horizontal split
layout splith
# vertical split
layout splitv
# toggle between split (keeping direction), stacked, tabbed
layout toggle
# toggle split directions ($mod+e)
layout toggle split
# toggle between all layouts splith, splitv, stacked, tabbed
layout toggle all
split is used to create a new split container with the currently focused window as its only member.
# create new vertical split ($mod+v)
split vertical
# create new horizontal split ($mod+h)
split horizontal
# create new split with opposing direction of parent container
split toggle
If split is called on the only window in a split container, it just changes the split direction accordingly without creating a new container around it. There are no options to create a new tabbed or stacked container directly.
Nomenclature
To avoid drawing a lot of ASCII representations of windows and containers I'll use the nomenclature i3 uses to show layouts when nesting containers inside stacked or tabbed layouts:
X[member member …]
in the title bar, where X is one of
V vertical split
H horizontal split
S stacked
T tabbed
and member is either the class name of a window or another container layout designation X[…] in the order of their appearance from left to right (in case of H and T) or top to bottom (in case of V and S).
How does it work
There are several ways to get to the desired layout of H[terminal T[terminal terminal]].
Change existing layout
Assuming you are actually starting out with H[terminal1 terminal2 terminal3] you have multiple options:
This general solution works in any situation, even the container in question is already inside another container:
split toggle on the rightmost window → H[terminal1 terminal2 V[terminal3]]
layout tabbed changes the layout on the new sub-container → H[terminal1 terminal2 T[terminal3]]
focus left selects the middle window (terminal2)
move right shifts the window into the tabbed container → H[terminal1 T[terminal2 terminal3]]
If these are the only windows on the workspace, you can also do without using split.
focus the leftmost window (terminal1)
move left moves the window outside of the original container, creating a new surrounding horizontal container → H[terminal1 H[terminal2 terminal3]
focus right
layout tabbed → H[terminal1 T[terminal2 terminal3]
Or you can do
layout tabbed → T[terminal1 terminal2 terminal3]
focus terminal1
move left moves the window out of the tabbed container → H[terminal1 T[terminal2 terminal3]]
So most of the time there are several ways to get from one layout to another. There are two basic strategies:
"Inwards" (the 1. example above)
use split toggle|vertical|horizontal to create a new container inside the original one
move other windows into it as desired
"Outwards" (the 2. and 3. examples above)
Change layout of the original container as desired
Move some windows out of it
The order of the steps does not really matter, but one or the other may be faster depending on the situation.
"Inwards" works in every case because all changes are contained in the original container, but it may take more actions and requires the use of split to create new containers. "Outwards" takes fewer actions in many cases and needs only focus and move commands, but it may not work well, if you already have surrounding containers.
Create layout while opening windows
In my experience one does not usually open all the windows and starts then arranging the layout. It is usually easier to modify the layout while you are opening windows. For example:
Open first terminal → H[termina1]
Open second terminal → H[terminal1 terminal2]
split toggle → H[terminal1 V[terminal2]]
layout tabbed → H[terminal1 T[terminal2]]
Open third terminal → H[terminal1 T[terminal2 terminal3]]
As you can see you actually only need two commands to get the desired layout - discounting the "Open" actions, which you have to do in any scenario anyway.
Other resources
User's Guide
Not really a tutorial, but the i3 User's Guide is very good and comprehensive. I strongly suggest to read it at least once, and not just because only a small part of the possibilities is actually realized in the default/example configuration.
For more advanced options on layout management have a look at the focus parent and focus child commands as well as the workspace_layout, default_orientation and maybe force_focus_wrapping settings.
Tree view from screencast
According to this post on the i3 discussion mailing list the tree view is created with the dump-asy.pl from the folder contrib in i3's sources. The latest version of it can be found here on GitHub
To get the view to be like in the screen cst, you need the following in your ~/.i3/config (change path and shortcut as required):
bindsym Mod1+x exec --no-startup-id /PATH/TO/dump-asy.pl 3
for_window [class="GV"] floating enable, border none
Alt+x will then open the view.
Here is what you need to do to get your desired effect (using default keys):
Open your three terminals: $mod+Enter, $mod+Enter, $mod+Enter
While focused on terminal 3, split the window with: $mod+v or $mod+h
Focus terminal 2, and move it to the right to split it with terminal 3: $mod+j, $mod+Shift+;
Switch to tabbed layout: $mod+w
Bonus Points :)
Open your four terminals: $mod+Enter, $mod+Enter, $mod+Enter, $mod+Enter
While focused on terminal 2, split the window with: $mod+v or $mod+h
Focus terminal 1, and move it to the right to split it with terminal 2: $mod+j, $mod+Shift+;
Switch to tabbed layout: $mod+w
Move focus to terminal 4: $mod+;, $mod+;
Split the window with: $mod+v or $mod+h
Focus terminal 3, and move it to the right to split it with terminal 4: $mod+j, $mod+Shift+;
Switch to tabbed layout: $mod+w

Related Links

i3-wm global floating window position
how to execute a function in i3 config?
i3wm - show tabs bar only if `mod` key is pressed
i3 layout loading script with no effect
do not wrap to another workspace when change focus in I3 WM
Display week day in i3 status bar
simple window layout management in i3 tiling window manager
How to launch synergy in i3
How to remove i3's split indicator?
i3 : assigning a program to a specific workspace but only for specific window_roles
Is there a startup file (like .bashrc) for i3 where i can set environmet variables?

Categories

HOME
converter
app-inventor
npm
checkbox
angular-cli
textwatcher
steam
actionscript
apollo
java-home
dropbear
hosts
xamarin-studio
rebol2
event-log
flexlm
linq-to-sql
koa
sumo
rhmap
owl-api
vcard
solidworks
partial-application
autofill
superagent
sharp
jboss5.x
referenceerror
nsurlconnection
xen
jboss-esb
bigcartel
rhel.net
inkscape
zero
visualstudio.testtools
viewgroup
react-native-router-flux
upsert
openweathermap
ajp
recycle-bin
windows-firewall
seamless-immutable
shutdown
workflow-foundation-4.5
scd
teiid
emgu
pdfkit
c#-interactive
wcf-ria-services
mix
logcat
amazon-kcl
yoothemes
void
windows-vista
unity5.3
sem
textkit
webhdfs
calibration
sparse-file
swift2.1
mdm-zinc
android-search
utf-32
left-recursion
libsndfile
fragment-tab-host
genetic-programming
author
emma
bsp
flash-cc
operations
jquery-tabs
magicalrecord-2.2
document-database
ng-hide
html-form-post
entity-framework-4.1
localtime
qss
fortran77
graph-coloring
template-haskell
transitive-closure-table
deploying
macruby
shim
signals2
userid
querystringparameter
electronic-signature
executable-format
exitstatus
surefire
jquery-ui-button
graniteds
microsoft.ink
virtualquery

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App