]> git.sur5r.net Git - i3/i3.github.io/blob - docs/userguide.html
update docs/userguide
[i3/i3.github.io] / docs / userguide.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
2     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
4 <head>\r
5 <link rel="icon" type="image/png" href="/favicon.png">\r
6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
7 <meta name="generator" content="AsciiDoc 8.6.4" />\r
8 <title>i3: i3 User’s Guide</title>\r
9 <link rel="stylesheet" href="/css/style.css" type="text/css" />\r
10 <link rel="stylesheet" href="/css/xhtml11.css" type="text/css" />\r
11 <script type="text/javascript">\r
12 /*<![CDATA[*/\r
13 window.onload = function(){asciidoc.footnotes(); asciidoc.toc(2);}\r
14 /*]]>*/\r
15 </script>\r
16 <script type="text/javascript" src="/js/asciidoc-xhtml11.js"></script>\r
17 </head>\r
18 <body class="article">\r
19 \r
20         <div id="main">\r
21             <a href="/"><h1 id="title">i3 - improved tiling WM</h1></a>\r
22                         <ul id="nav">\r
23                                 <li><a style="border-bottom: 2px solid #fff" href="/docs">Docs</a></li>\r
24                                 <li><a href="/screenshots">Screens</a></li>\r
25                                 <li><a href="/contact">Contact</a></li>\r
26                                 <li><a href="http://bugs.i3wm.org/">Bugs</a></li>\r
27                         </ul>\r
28         <br style="clear: both">\r
29 <div id="content">\r
30 <div id="header">\r
31 <h1>i3 User’s Guide</h1>\r
32 <span id="author">Michael Stapelberg</span><br />\r
33 <span id="email"><tt>&lt;<a href="mailto:michael+i3@stapelberg.de">michael+i3@stapelberg.de</a>&gt;</tt></span><br />\r
34 <span id="revdate">August 2011</span>\r
35 <div id="toc">
36   <div id="toctitle">Table of Contents</div>
37   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
38 </div>\r
39 </div>\r
40 <div id="preamble">\r
41 <div class="sectionbody">\r
42 <div class="paragraph"><p>This document contains all the information you need to configure and use the i3\r
43 window manager. If it does not, please contact us on IRC (preferred) or post your\r
44 question(s) on the mailing list.</p></div>\r
45 </div>\r
46 </div>\r
47 <div class="sect1">\r
48 <h2 id="_default_keybindings">1. Default keybindings</h2>\r
49 <div class="sectionbody">\r
50 <div class="paragraph"><p>For the "too long; didn’t read" people, here is an overview of the default\r
51 keybindings (click to see the full size image):</p></div>\r
52 <div class="paragraph"><p><strong>Keys to use with mod (alt):</strong></p></div>\r
53 <div class="paragraph"><p><span class="image">\r
54 <a class="image" href="keyboard-layer1.png">\r
55 <img src="keyboard-layer1.png" alt="Keys to use with mod (alt)" width="600" />\r
56 </a>\r
57 </span></p></div>\r
58 <div class="paragraph"><p><strong>Keys to use with Shift+mod:</strong></p></div>\r
59 <div class="paragraph"><p><span class="image">\r
60 <a class="image" href="keyboard-layer2.png">\r
61 <img src="keyboard-layer2.png" alt="Keys to use with Shift+mod" width="600" />\r
62 </a>\r
63 </span></p></div>\r
64 <div class="paragraph"><p>The red keys are the modifiers you need to press (by default), the blue keys\r
65 are your homerow.</p></div>\r
66 </div>\r
67 </div>\r
68 <div class="sect1">\r
69 <h2 id="_using_i3">2. Using i3</h2>\r
70 <div class="sectionbody">\r
71 <div class="paragraph"><p>Throughout this guide, the keyword <tt>mod</tt> will be used to refer to the\r
72 configured modifier. This is the alt key (Mod1) by default, with windows (Mod4)\r
73 being a popular alternative.</p></div>\r
74 <div class="sect2">\r
75 <h3 id="_opening_terminals_and_moving_around">2.1. Opening terminals and moving around</h3>\r
76 <div class="paragraph"><p>One very basic operation is opening a new terminal. By default, the keybinding\r
77 for this is mod+Enter, that is Alt+Enter in the default configuration. By\r
78 pressing mod+Enter, a new terminal will be opened.  It will fill the whole\r
79 space available on your screen.</p></div>\r
80 <div class="paragraph"><p><span class="image">\r
81 <img src="single_terminal.png" alt="Single terminal" />\r
82 </span></p></div>\r
83 <div class="paragraph"><p>If you now open another terminal, i3 will place it next to the current one,\r
84 splitting the screen size in half. Depending on your monitor, i3 will put the\r
85 created window beside the existing window (on wide displays) or below the\r
86 existing window (rotated displays).</p></div>\r
87 <div class="paragraph"><p><span class="image">\r
88 <img src="two_terminals.png" alt="Two terminals" />\r
89 </span></p></div>\r
90 <div class="paragraph"><p>To move the focus between the two terminals, you can use the direction keys\r
91 which you may know from the editor <tt>vi</tt>. However, in i3, your homerow is used\r
92 for these keys (in <tt>vi</tt>, the keys are shifted to the left by one for\r
93 compatibility with most keyboard layouts). Therefore, <tt>mod+J</tt> is left, <tt>mod+K</tt>\r
94 is down, <tt>mod+L</tt> is up and <tt>mod+;</tt> is right. So, to switch between the\r
95 terminals, use <tt>mod+K</tt> or <tt>mod+L</tt>. Of course, you can also use the arrow keys.</p></div>\r
96 <div class="paragraph"><p>At the moment, your workspace is split (it contains two terminals) in a\r
97 specific direction (horizontal by default). Every window can be split\r
98 horizontally or vertically again, just like the workspace. The terminology is\r
99 "window" for a container that actually contains an X11 window (like a terminal\r
100 or browser) and "split container" for containers that consist of one or more\r
101 windows.</p></div>\r
102 <div class="paragraph"><p>TODO: picture of the tree</p></div>\r
103 <div class="paragraph"><p>To split a window vertically, press <tt>mod+v</tt>. To split it horizontally, press\r
104 <tt>mod+h</tt>.</p></div>\r
105 </div>\r
106 <div class="sect2">\r
107 <h3 id="_changing_the_container_layout">2.2. Changing the container layout</h3>\r
108 <div class="paragraph"><p>A split container can have one of the following layouts:</p></div>\r
109 <div class="dlist"><dl>\r
110 <dt class="hdlist1">\r
111 default\r
112 </dt>\r
113 <dd>\r
114 <p>\r
115 Windows are sized so that every window gets an equal amount of space in the\r
116 container.\r
117 </p>\r
118 </dd>\r
119 <dt class="hdlist1">\r
120 stacking\r
121 </dt>\r
122 <dd>\r
123 <p>\r
124 Only the focused window in the container is displayed. You get a list of\r
125 windows at the top of the container.\r
126 </p>\r
127 </dd>\r
128 <dt class="hdlist1">\r
129 tabbed\r
130 </dt>\r
131 <dd>\r
132 <p>\r
133 The same principle as <tt>stacking</tt>, but the list of windows at the top is only\r
134 a single line which is vertically split.\r
135 </p>\r
136 </dd>\r
137 </dl></div>\r
138 <div class="paragraph"><p>To switch modes, press <tt>mod+e</tt> for default, <tt>mod+s</tt> for stacking and\r
139 <tt>mod+w</tt> for tabbed.</p></div>\r
140 <div class="paragraph"><p><span class="image">\r
141 <img src="modes.png" alt="Container modes" />\r
142 </span></p></div>\r
143 </div>\r
144 <div class="sect2">\r
145 <h3 id="_toggling_fullscreen_mode_for_a_window">2.3. Toggling fullscreen mode for a window</h3>\r
146 <div class="paragraph"><p>To display a window in fullscreen mode or to go out of fullscreen mode again,\r
147 press <tt>mod+f</tt>.</p></div>\r
148 <div class="paragraph"><p>There is also a global fullscreen mode in i3 in which the client will span all\r
149 available outputs.</p></div>\r
150 </div>\r
151 <div class="sect2">\r
152 <h3 id="_opening_other_applications">2.4. Opening other applications</h3>\r
153 <div class="paragraph"><p>Aside from opening applications from a terminal, you can also use the handy\r
154 <tt>dmenu</tt> which is opened by pressing <tt>mod+d</tt> by default. Just type the name\r
155 (or a part of it) of the application which you want to open. The corresponding\r
156 application has to be in your <tt>$PATH</tt> for this to work.</p></div>\r
157 <div class="paragraph"><p>Additionally, if you have applications you open very frequently, you can\r
158 create a keybinding for starting the application directly. See the section\r
159 <a href="#configuring">[configuring]</a> for details.</p></div>\r
160 </div>\r
161 <div class="sect2">\r
162 <h3 id="_closing_windows">2.5. Closing windows</h3>\r
163 <div class="paragraph"><p>If an application does not provide a mechanism for closing (most applications\r
164 provide a menu, the escape key or a shortcut like <tt>Control+W</tt> to close), you\r
165 can press <tt>mod+Shift+q</tt> to kill a window. For applications which support\r
166 the WM_DELETE protocol, this will correctly close the application (saving\r
167 any modifications or doing other cleanup). If the application doesn’t support\r
168 the WM_DELETE protocol your X server will kill the window and the behaviour\r
169 depends on the application.</p></div>\r
170 </div>\r
171 <div class="sect2">\r
172 <h3 id="_using_workspaces">2.6. Using workspaces</h3>\r
173 <div class="paragraph"><p>Workspaces are an easy way to group a set of windows. By default, you are on\r
174 the first workspace, as the bar on the bottom left indicates. To switch to\r
175 another workspace, press <tt>mod+num</tt> where <tt>num</tt> is the number of the workspace\r
176 you want to use. If the workspace does not exist yet, it will be created.</p></div>\r
177 <div class="paragraph"><p>A common paradigm is to put the web browser on one workspace, communication\r
178 applications (<tt>mutt</tt>, <tt>irssi</tt>, &#8230;) on another one, and the ones with which you\r
179 work, on the third one. Of course, there is no need to follow this approach.</p></div>\r
180 <div class="paragraph"><p>If you have multiple screens, a workspace will be created on each screen at\r
181 startup. If you open a new workspace, it will be bound to the screen you\r
182 created it on.  When you switch to a workspace on another screen, i3 will set\r
183 focus to that screen.</p></div>\r
184 </div>\r
185 <div class="sect2">\r
186 <h3 id="_moving_windows_to_workspaces">2.7. Moving windows to workspaces</h3>\r
187 <div class="paragraph"><p>To move a window to another workspace, simply press <tt>mod+Shift+num</tt> where\r
188 <tt>num</tt> is (like when switching workspaces) the number of the target workspace.\r
189 Similarly to switching workspaces, the target workspace will be created if\r
190 it does not yet exist.</p></div>\r
191 </div>\r
192 <div class="sect2">\r
193 <h3 id="_resizing">2.8. Resizing</h3>\r
194 <div class="paragraph"><p>The easiest way to resize a container is by using the mouse: Grab the border\r
195 and move it to the wanted size.</p></div>\r
196 <div class="paragraph"><p>See <a href="#resizingconfig">[resizingconfig]</a> for how to configure i3 to be able to resize\r
197 columns/rows with your keyboard.</p></div>\r
198 </div>\r
199 <div class="sect2">\r
200 <h3 id="_restarting_i3_inplace">2.9. Restarting i3 inplace</h3>\r
201 <div class="paragraph"><p>To restart i3 inplace (and thus get into a clean state if there is a bug, or\r
202 to upgrade to a newer version of i3) you can use <tt>mod+Shift+r</tt>.</p></div>\r
203 </div>\r
204 <div class="sect2">\r
205 <h3 id="_exiting_i3">2.10. Exiting i3</h3>\r
206 <div class="paragraph"><p>To cleanly exit i3 without killing your X server, you can use <tt>mod+Shift+e</tt>.</p></div>\r
207 </div>\r
208 <div class="sect2">\r
209 <h3 id="_floating">2.11. Floating</h3>\r
210 <div class="paragraph"><p>Floating mode is the opposite of tiling mode. The position and size of a window\r
211 are not managed by i3, but by you. Using this mode violates the tiling\r
212 paradigm but can be useful for some corner cases like "Save as" dialog\r
213 windows, or toolbar windows (GIMP or similar). Those windows usually set the\r
214 appropriate hint and are opened in floating mode by default.</p></div>\r
215 <div class="paragraph"><p>You can toggle floating mode for a window by pressing <tt>mod+Shift+Space</tt>. By\r
216 dragging the window’s titlebar with your mouse you can move the window\r
217 around. By grabbing the borders and moving them you can resize the window. You\r
218 can also do that by using the <a href="#floating_modifier">[floating_modifier]</a>.</p></div>\r
219 <div class="paragraph"><p>For resizing floating windows with your keyboard, see <a href="#resizingconfig">[resizingconfig]</a>.</p></div>\r
220 <div class="paragraph"><p>Floating windows are always on top of tiling windows.</p></div>\r
221 </div>\r
222 </div>\r
223 </div>\r
224 <div class="sect1">\r
225 <h2 id="_tree">3. Tree</h2>\r
226 <div class="sectionbody">\r
227 <div class="paragraph"><p>i3 stores all information about the X11 outputs, workspaces and layout of the\r
228 windows on them in a tree. The root node is the X11 root window, followed by\r
229 the X11 outputs, then dock areas and a content container, then workspaces and\r
230 finally the windows themselve. In previous versions of i3 we had multiple lists\r
231 (of outputs, workspaces) and a table for each workspace. That approach turned\r
232 out to be complicated to use (snapping), understand and implement.</p></div>\r
233 <div class="sect2">\r
234 <h3 id="_the_tree_consists_of_containers">3.1. The tree consists of Containers</h3>\r
235 <div class="paragraph"><p>The building blocks of our tree are so called <tt>Containers</tt>. A <tt>Container</tt> can\r
236 host a window (meaning an X11 window, one that you can actually see and use,\r
237 like a browser). Alternatively, it could contain one or more <tt>Containers</tt>. A\r
238 simple example is the workspace: When you start i3 with a single monitor, a\r
239 single workspace and you open two terminal windows, you will end up with a tree\r
240 like this:</p></div>\r
241 <div class="imageblock" style="float:right;">\r
242 <div class="content">\r
243 <img src="tree-layout2.png" alt="layout2" />\r
244 </div>\r
245 </div>\r
246 <div class="imageblock">\r
247 <div class="content">\r
248 <img src="tree-shot4.png" alt="shot4" />\r
249 </div>\r
250 <div class="title">Figure 1. Two terminals on standard workspace</div>\r
251 </div>\r
252 </div>\r
253 <div class="sect2">\r
254 <h3 id="_orientation_and_split_containers">3.2. Orientation and Split Containers</h3>\r
255 <div class="paragraph" id="OrientationSplit"><p>It is only natural to use so-called <tt>Split Containers</tt> in order to build a\r
256 layout when using a tree as data structure. In i3, every <tt>Container</tt> has an\r
257 orientation (horizontal, vertical or unspecified). So, in our example with the\r
258 workspace, the default orientation of the workspace <tt>Container</tt> is horizontal\r
259 (most monitors are widescreen nowadays). If you change the orientation to\r
260 vertical (<tt>mod+v</tt> in the default config) and <strong>then</strong> open two terminals, i3 will\r
261 configure your windows like this:</p></div>\r
262 <div class="imageblock">\r
263 <div class="content">\r
264 <img src="tree-shot2.png" alt="shot2" />\r
265 </div>\r
266 <div class="title">Figure 2. Vertical Workspace Orientation</div>\r
267 </div>\r
268 <div class="paragraph"><p>An interesting new feature of the tree branch is the ability to split anything:\r
269 Let’s assume you have two terminals on a workspace (with horizontal\r
270 orientation), focus is on the right terminal. Now you want to open another\r
271 terminal window below the current one. If you would just open a new terminal\r
272 window, it would show up to the right due to the horizontal workspace\r
273 orientation. Instead, press <tt>mod+v</tt> to create a <tt>Vertical Split Container</tt> (to\r
274 open a <tt>Horizontal Split Container</tt>, use <tt>mod+h</tt>). Now you can open a new\r
275 terminal and it will open below the current one:</p></div>\r
276 <div class="imageblock" style="float:right;">\r
277 <div class="content">\r
278 <img src="tree-layout1.png" alt="Layout" />\r
279 </div>\r
280 </div>\r
281 <div class="imageblock">\r
282 <div class="content">\r
283 <img src="tree-shot1.png" alt="shot" />\r
284 </div>\r
285 <div class="title">Figure 3. Vertical Split Container</div>\r
286 </div>\r
287 <div style="clear:both;"></div>\r
288 <div class="paragraph"><p>You probably guessed it already: There is no limit on how deep your hierarchy\r
289 of splits can be.</p></div>\r
290 </div>\r
291 <div class="sect2">\r
292 <h3 id="_focus_parent">3.3. Focus parent</h3>\r
293 <div class="paragraph"><p>Let’s stay with our example from above. We have a terminal on the left and two\r
294 vertically split terminals on the right, focus is on the bottom right one. When\r
295 you open a new terminal, it will open below the current one.</p></div>\r
296 <div class="paragraph"><p>So, how can you open a new terminal window to the <strong>right</strong> of the current one?\r
297 The solution is to use <tt>focus parent</tt>, which will focus the <tt>Parent Container</tt> of\r
298 the current <tt>Container</tt>. In this case, you would focus the <tt>Vertical Split\r
299 Container</tt> which is <strong>inside</strong> the horizontally oriented workspace. Thus, now new\r
300 windows will be opened to the right of the <tt>Vertical Split Container</tt>:</p></div>\r
301 <div class="imageblock">\r
302 <div class="content">\r
303 <img src="tree-shot3.png" alt="shot3" />\r
304 </div>\r
305 <div class="title">Figure 4. Focus parent, then open new terminal</div>\r
306 </div>\r
307 </div>\r
308 </div>\r
309 </div>\r
310 <div class="sect1">\r
311 <h2 id="configuring">4. Configuring i3</h2>\r
312 <div class="sectionbody">\r
313 <div class="paragraph"><p>This is where the real fun begins ;-). Most things are very dependant on your\r
314 ideal working environment so we can’t make reasonable defaults for them.</p></div>\r
315 <div class="paragraph"><p>While not using a programming language for the configuration, i3 stays\r
316 quite flexible in regards to the things you usually want your window manager\r
317 to do.</p></div>\r
318 <div class="paragraph"><p>For example, you can configure bindings to jump to specific windows,\r
319 you can set specific applications to start on specific workspaces, you can\r
320 automatically start applications, you can change the colors of i3, and you\r
321 can bind your keys to do useful things.</p></div>\r
322 <div class="paragraph"><p>To change the configuration of i3, copy <tt>/etc/i3/config</tt> to <tt>~/.i3/config</tt>\r
323 (or <tt>~/.config/i3/config</tt> if you like the XDG directory scheme) and edit it\r
324 with a text editor.</p></div>\r
325 <div class="paragraph"><p>On first start (and on all following starts, unless you have a configuration\r
326 file), i3 will offer you to create a configuration file. You can tell the\r
327 wizard to use either Alt (Mod1) or Windows (Mod4) as modifier in the config\r
328 file. Also, the created config file will use the key symbols of your current\r
329 keyboard layout. To start the wizard, use the command <tt>i3-config-wizard</tt>.\r
330 Please note that you must not have <tt>~/.i3/config</tt>, otherwise the wizard will\r
331 exit.</p></div>\r
332 <div class="sect2">\r
333 <h3 id="_comments">4.1. Comments</h3>\r
334 <div class="paragraph"><p>It is possible and recommended to use comments in your configuration file to\r
335 properly document your setup for later reference. Comments are started with\r
336 a # and can only be used at the beginning of a line:</p></div>\r
337 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
338 <div class="listingblock">\r
339 <div class="content">\r
340 <pre><tt># This is a comment</tt></pre>\r
341 </div></div>\r
342 </div>\r
343 <div class="sect2">\r
344 <h3 id="_fonts">4.2. Fonts</h3>\r
345 <div class="paragraph"><p>i3 uses X core fonts (not Xft) for rendering window titles. You can use\r
346 <tt>xfontsel(1)</tt> to generate such a font description. To see special characters\r
347 (Unicode), you need to use a font which supports the ISO-10646 encoding.</p></div>\r
348 <div class="paragraph"><p>If i3 cannot open the configured font, it will output an error in the logfile\r
349 and fall back to a working font.</p></div>\r
350 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
351 <div class="listingblock">\r
352 <div class="content">\r
353 <pre><tt>font &lt;X core font description&gt;</tt></pre>\r
354 </div></div>\r
355 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
356 <div class="listingblock">\r
357 <div class="content">\r
358 <pre><tt>font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1</tt></pre>\r
359 </div></div>\r
360 </div>\r
361 <div class="sect2">\r
362 <h3 id="keybindings">4.3. Keyboard bindings</h3>\r
363 <div class="paragraph"><p>A keyboard binding makes i3 execute a command (see below) upon pressing a\r
364 specific key. i3 allows you to bind either on keycodes or on keysyms (you can\r
365 also mix your bindings, though i3 will not protect you from overlapping ones).</p></div>\r
366 <div class="ulist"><ul>\r
367 <li>\r
368 <p>\r
369 A keysym (key symbol) is a description for a specific symbol, like "a"\r
370   or "b", but also more strange ones like "underscore" instead of "_". These\r
371   are the ones you use in Xmodmap to remap your keys. To get the current\r
372   mapping of your keys, use <tt>xmodmap -pke</tt>.\r
373 </p>\r
374 </li>\r
375 <li>\r
376 <p>\r
377 Keycodes do not need to have a symbol assigned (handy for custom vendor\r
378   hotkeys on some notebooks) and they will not change their meaning as you\r
379   switch to a different keyboard layout (when using <tt>xmodmap</tt>).\r
380 </p>\r
381 </li>\r
382 </ul></div>\r
383 <div class="paragraph"><p>My recommendation is: If you often switch keyboard layouts but you want to keep\r
384 your bindings in the same physical location on the keyboard, use keycodes.\r
385 If you don’t switch layouts, and want a clean and simple config file, use\r
386 keysyms.</p></div>\r
387 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
388 <div class="listingblock">\r
389 <div class="content">\r
390 <pre><tt>bindsym [Modifiers+]keysym command\r
391 bindcode [Modifiers+]keycode command</tt></pre>\r
392 </div></div>\r
393 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
394 <div class="listingblock">\r
395 <div class="content">\r
396 <pre><tt># Fullscreen\r
397 bindsym mod+f f\r
398 \r
399 # Restart\r
400 bindsym mod+Shift+r restart\r
401 \r
402 # Notebook-specific hotkeys\r
403 bindcode 214 exec /home/michael/toggle_beamer.sh</tt></pre>\r
404 </div></div>\r
405 <div class="paragraph"><p>Available Modifiers:</p></div>\r
406 <div class="dlist"><dl>\r
407 <dt class="hdlist1">\r
408 Mod1-Mod5, Shift, Control\r
409 </dt>\r
410 <dd>\r
411 <p>\r
412 Standard modifiers, see <tt>xmodmap(1)</tt>\r
413 </p>\r
414 </dd>\r
415 <dt class="hdlist1">\r
416 Mode_switch\r
417 </dt>\r
418 <dd>\r
419 <p>\r
420 Unlike other window managers, i3 can use Mode_switch as a modifier. This allows\r
421 you to remap capslock (for example) to Mode_switch and use it for both: typing\r
422 umlauts or special characters <em>and</em> having some comfortably reachable key\r
423 bindings. For example, when typing, capslock+1 or capslock+2 for switching\r
424 workspaces is totally convenient. Try it :-).\r
425 </p>\r
426 </dd>\r
427 </dl></div>\r
428 </div>\r
429 <div class="sect2">\r
430 <h3 id="floating_modifier">4.4. The floating modifier</h3>\r
431 <div class="paragraph"><p>To move floating windows with your mouse, you can either grab their titlebar\r
432 or configure the so called floating modifier which you can then press and\r
433 click anywhere in the window itself to move it. The most common setup is to\r
434 use the same key you use for managing windows (Mod1 for example). Then\r
435 you can press Mod1, click into a window using your left mouse button, and drag\r
436 it to the position you want.</p></div>\r
437 <div class="paragraph"><p>When holding the floating modifier, you can resize a floating window by\r
438 pressing the right mouse button on it and moving around while holding it. If\r
439 you hold the shift button as well, the resize will be proportional.</p></div>\r
440 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
441 <div class="listingblock">\r
442 <div class="content">\r
443 <pre><tt>floating_modifier &lt;Modifiers&gt;</tt></pre>\r
444 </div></div>\r
445 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
446 <div class="listingblock">\r
447 <div class="content">\r
448 <pre><tt>floating_modifier Mod1</tt></pre>\r
449 </div></div>\r
450 </div>\r
451 <div class="sect2">\r
452 <h3 id="_orientation_for_new_workspaces">4.5. Orientation for new workspaces</h3>\r
453 <div class="paragraph"><p>New workspaces get a reasonable default orientation: Wide-screen monitors\r
454 (anything wider than high) get horizontal orientation, rotated monitors\r
455 (anything higher than wide) get vertical orientation.</p></div>\r
456 <div class="paragraph"><p>With the <tt>default_orientation</tt> configuration directive, you can override that\r
457 behaviour.</p></div>\r
458 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
459 <div class="listingblock">\r
460 <div class="content">\r
461 <pre><tt>default_orientation &lt;horizontal|vertical|auto&gt;</tt></pre>\r
462 </div></div>\r
463 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
464 <div class="listingblock">\r
465 <div class="content">\r
466 <pre><tt>default_orientation vertical</tt></pre>\r
467 </div></div>\r
468 </div>\r
469 <div class="sect2">\r
470 <h3 id="_layout_mode_for_new_containers">4.6. Layout mode for new containers</h3>\r
471 <div class="paragraph"><p>This option determines in which mode new containers on workspace level will\r
472 start.</p></div>\r
473 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
474 <div class="listingblock">\r
475 <div class="content">\r
476 <pre><tt>workspace_layout &lt;default|stacking|tabbed&gt;</tt></pre>\r
477 </div></div>\r
478 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
479 <div class="listingblock">\r
480 <div class="content">\r
481 <pre><tt>workspace_layout tabbed</tt></pre>\r
482 </div></div>\r
483 </div>\r
484 <div class="sect2">\r
485 <h3 id="_border_style_for_new_windows">4.7. Border style for new windows</h3>\r
486 <div class="paragraph"><p>This option determines which border style new windows will have.</p></div>\r
487 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
488 <div class="listingblock">\r
489 <div class="content">\r
490 <pre><tt>new_window &lt;normal|1pixel|none&gt;</tt></pre>\r
491 </div></div>\r
492 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
493 <div class="listingblock">\r
494 <div class="content">\r
495 <pre><tt>new_window 1pixel</tt></pre>\r
496 </div></div>\r
497 </div>\r
498 <div class="sect2">\r
499 <h3 id="_arbitrary_commands_for_specific_windows_for_window">4.8. Arbitrary commands for specific windows (for_window)</h3>\r
500 <div class="paragraph"><p>With the <tt>for_window</tt> command, you can let i3 execute any command when it\r
501 encounters a specific window. This can be used to set windows to floating or to\r
502 change their border style, for example.</p></div>\r
503 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
504 <div class="listingblock">\r
505 <div class="content">\r
506 <pre><tt>for_window [criteria] command</tt></pre>\r
507 </div></div>\r
508 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
509 <div class="listingblock">\r
510 <div class="content">\r
511 <pre><tt># enable floating mode for all XTerm windows\r
512 for_window [class="XTerm"] floating enable\r
513 \r
514 # Make all urxvts use a 1-pixel border:\r
515 for_window [class="urxvt"] border 1pixel\r
516 \r
517 # A less useful, but rather funny example:\r
518 # makes the window floating as soon as I change\r
519 # directory to ~/work\r
520 for_window [title="x200: ~/work"] floating enable</tt></pre>\r
521 </div></div>\r
522 <div class="paragraph"><p>The valid criteria are the same as those for commands, see <a href="#command_criteria">[command_criteria]</a>.</p></div>\r
523 </div>\r
524 <div class="sect2">\r
525 <h3 id="_variables">4.9. Variables</h3>\r
526 <div class="paragraph"><p>As you learned in the section about keyboard bindings, you will have\r
527 to configure lots of bindings containing modifier keys. If you want to save\r
528 yourself some typing and be able to change the modifier you use later,\r
529 variables can be handy.</p></div>\r
530 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
531 <div class="listingblock">\r
532 <div class="content">\r
533 <pre><tt>set $name value</tt></pre>\r
534 </div></div>\r
535 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
536 <div class="listingblock">\r
537 <div class="content">\r
538 <pre><tt>set $m Mod1\r
539 bindsym $m+Shift+r restart</tt></pre>\r
540 </div></div>\r
541 <div class="paragraph"><p>Variables are directly replaced in the file when parsing. There is no fancy\r
542 handling and there are absolutely no plans to change this. If you need a more\r
543 dynamic configuration you should create a little script which generates a\r
544 configuration file and run it before starting i3 (for example in your\r
545 <tt>~/.xsession</tt> file).</p></div>\r
546 </div>\r
547 <div class="sect2">\r
548 <h3 id="_automatically_putting_clients_on_specific_workspaces">4.10. Automatically putting clients on specific workspaces</h3>\r
549 <div class="paragraph" id="assign_workspace"><p>Specific windows can be matched by window class and/or window title. It is\r
550 recommended that you match on window classes instead of window titles whenever\r
551 possible because some applications first create their window, and then worry\r
552 about setting the correct title. Firefox with Vimperator comes to mind. The\r
553 window starts up being named Firefox, and only when Vimperator is loaded does\r
554 the title change. As i3 will get the title as soon as the application maps the\r
555 window (mapping means actually displaying it on the screen), you’d need to have\r
556 to match on <em>Firefox</em> in this case.</p></div>\r
557 <div class="paragraph"><p>You can prefix or suffix workspaces with a <tt>~</tt> to specify that matching clients\r
558 should be put into floating mode. If you specify only a <tt>~</tt>, the client will\r
559 not be put onto any workspace, but will be set floating on the current one.</p></div>\r
560 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
561 <div class="listingblock">\r
562 <div class="content">\r
563 <pre><tt>assign ["]window class[/window title]["] [→] [workspace]</tt></pre>\r
564 </div></div>\r
565 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
566 <div class="listingblock">\r
567 <div class="content">\r
568 <pre><tt>assign urxvt 2\r
569 assign urxvt → 2\r
570 assign urxvt → work\r
571 assign "urxvt" → 2\r
572 assign "urxvt/VIM" → 3\r
573 assign "gecko" → 4</tt></pre>\r
574 </div></div>\r
575 <div class="paragraph"><p>Note that the arrow is not required, it just looks good :-). If you decide to\r
576 use it, it has to be a UTF-8 encoded arrow, not <tt>-&gt;</tt> or something like that.</p></div>\r
577 </div>\r
578 <div class="sect2">\r
579 <h3 id="_automatically_starting_applications_on_i3_startup">4.11. Automatically starting applications on i3 startup</h3>\r
580 <div class="paragraph"><p>By using the <tt>exec</tt> keyword outside a keybinding, you can configure\r
581 which commands will be performed by i3 on initial startup. <tt>exec</tt>\r
582 commands will not run when restarting i3, if you need a command to run\r
583 also when restarting i3 you should use the <tt>exec_always</tt>\r
584 keyword. These commands will be run in order.</p></div>\r
585 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
586 <div class="listingblock">\r
587 <div class="content">\r
588 <pre><tt>exec command\r
589 exec_always command</tt></pre>\r
590 </div></div>\r
591 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
592 <div class="listingblock">\r
593 <div class="content">\r
594 <pre><tt>exec i3status | i3bar -d\r
595 exec_always ~/my_script.sh</tt></pre>\r
596 </div></div>\r
597 </div>\r
598 <div class="sect2">\r
599 <h3 id="workspace_screen">4.12. Automatically putting workspaces on specific screens</h3>\r
600 <div class="paragraph"><p>If you assign clients to workspaces, it might be handy to put the\r
601 workspaces on specific screens. Also, the assignment of workspaces to screens\r
602 will determine which workspace i3 uses for a new screen when adding screens\r
603 or when starting (e.g., by default it will use 1 for the first screen, 2 for\r
604 the second screen and so on).</p></div>\r
605 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
606 <div class="listingblock">\r
607 <div class="content">\r
608 <pre><tt>workspace &lt;number&gt; output &lt;output&gt;</tt></pre>\r
609 </div></div>\r
610 <div class="paragraph"><p>The <em>output</em> is the name of the RandR output you attach your screen to. On a\r
611 laptop, you might have VGA1 and LVDS1 as output names. You can see the\r
612 available outputs by running <tt>xrandr --current</tt>.</p></div>\r
613 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
614 <div class="listingblock">\r
615 <div class="content">\r
616 <pre><tt>workspace 1 output LVDS1\r
617 workspace 5 output VGA1</tt></pre>\r
618 </div></div>\r
619 </div>\r
620 <div class="sect2">\r
621 <h3 id="_changing_colors">4.13. Changing colors</h3>\r
622 <div class="paragraph"><p>You can change all colors which i3 uses to draw the window decorations.</p></div>\r
623 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
624 <div class="listingblock">\r
625 <div class="content">\r
626 <pre><tt>colorclass border background text</tt></pre>\r
627 </div></div>\r
628 <div class="paragraph"><p>Where colorclass can be one of:</p></div>\r
629 <div class="dlist"><dl>\r
630 <dt class="hdlist1">\r
631 client.focused\r
632 </dt>\r
633 <dd>\r
634 <p>\r
635         A client which currently has the focus.\r
636 </p>\r
637 </dd>\r
638 <dt class="hdlist1">\r
639 client.focused_inactive\r
640 </dt>\r
641 <dd>\r
642 <p>\r
643         A client which is the focused one of its container, but it does not have\r
644         the focus at the moment.\r
645 </p>\r
646 </dd>\r
647 <dt class="hdlist1">\r
648 client.unfocused\r
649 </dt>\r
650 <dd>\r
651 <p>\r
652         A client which is not the focused one of its container.\r
653 </p>\r
654 </dd>\r
655 <dt class="hdlist1">\r
656 client.urgent\r
657 </dt>\r
658 <dd>\r
659 <p>\r
660         A client which has its urgency hint activated.\r
661 </p>\r
662 </dd>\r
663 </dl></div>\r
664 <div class="paragraph"><p>You can also specify the color to be used to paint the background of the client\r
665 windows. This color will be used to paint the window on top of which the client\r
666 will be rendered.</p></div>\r
667 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
668 <div class="listingblock">\r
669 <div class="content">\r
670 <pre><tt>client.background color</tt></pre>\r
671 </div></div>\r
672 <div class="paragraph"><p>Only clients that do not cover the whole area of this window expose the color\r
673 used to paint it. If you use a color other than black for your terminals, you\r
674 most likely want to set the client background color to the same color as your\r
675 terminal program&#8217;s background color to avoid black gaps between the rendered\r
676 area of the termianal and the i3 border.</p></div>\r
677 <div class="paragraph"><p>Colors are in HTML hex format (#rrggbb), see the following example:</p></div>\r
678 <div class="paragraph"><p><strong>Examples (default colors)</strong>:</p></div>\r
679 <div class="listingblock">\r
680 <div class="content">\r
681 <pre><tt># class                 border  backgr. text\r
682 client.focused          #4c7899 #285577 #ffffff\r
683 client.focused_inactive #333333 #5f676a #ffffff\r
684 client.unfocused        #333333 #222222 #888888\r
685 client.urgent           #2f343a #900000 #ffffff</tt></pre>\r
686 </div></div>\r
687 <div class="paragraph"><p>Note that for the window decorations, the color around the child window is the\r
688 background color, and the border color is only the two thin lines at the top of\r
689 the window.</p></div>\r
690 </div>\r
691 <div class="sect2">\r
692 <h3 id="_interprocess_communication">4.14. Interprocess communication</h3>\r
693 <div class="paragraph"><p>i3 uses unix sockets to provide an IPC interface. This allows third-party\r
694 programs to get information from i3, such as the current workspaces\r
695 (to display a workspace bar), and to control i3.</p></div>\r
696 <div class="paragraph"><p>The IPC socket is enabled by default and will be created in\r
697 <tt>/tmp/i3-%u/ipc-socket.%p</tt> where <tt>%u</tt> is your UNIX username and <tt>%p</tt> is the PID\r
698 of i3.</p></div>\r
699 <div class="paragraph"><p>You can override the default path through the environment-variable <tt>I3SOCK</tt> or\r
700 by specifying the <tt>ipc-socket</tt> directive. This is discouraged, though, since i3\r
701 does the right thing by default.</p></div>\r
702 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
703 <div class="listingblock">\r
704 <div class="content">\r
705 <pre><tt>ipc-socket /tmp/i3-ipc.sock</tt></pre>\r
706 </div></div>\r
707 <div class="paragraph"><p>You can then use the <tt>i3-msg</tt> application to perform any command listed in\r
708 the next section.</p></div>\r
709 </div>\r
710 <div class="sect2">\r
711 <h3 id="_focus_follows_mouse">4.15. Focus follows mouse</h3>\r
712 <div class="paragraph"><p>If you have a setup where your mouse usually is in your way (like a touchpad\r
713 on your laptop which you do not want to disable completely), you might want\r
714 to disable <em>focus follows mouse</em> and control focus only by using your keyboard.\r
715 The mouse will still be useful inside the currently active window (for example\r
716 to click on links in your browser window).</p></div>\r
717 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
718 <div class="listingblock">\r
719 <div class="content">\r
720 <pre><tt>focus_follows_mouse &lt;yes|no&gt;</tt></pre>\r
721 </div></div>\r
722 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
723 <div class="listingblock">\r
724 <div class="content">\r
725 <pre><tt>focus_follows_mouse no</tt></pre>\r
726 </div></div>\r
727 </div>\r
728 <div class="sect2">\r
729 <h3 id="_popups_during_fullscreen_mode">4.16. Popups during fullscreen mode</h3>\r
730 <div class="paragraph"><p>When you are in fullscreen mode, some applications still open popup windows\r
731 (take Xpdf for example). This is because these applications may not be aware\r
732 that they are in fullscreen mode (they do not check the corresponding hint).\r
733 There are two things which are possible to do in this situation:</p></div>\r
734 <div class="olist arabic"><ol class="arabic">\r
735 <li>\r
736 <p>\r
737 Just ignore the popup (don’t map it). This won’t interrupt you while you are\r
738    in fullscreen. However, some apps might react badly to this (deadlock until\r
739    you go out of fullscreen).\r
740 </p>\r
741 </li>\r
742 <li>\r
743 <p>\r
744 Leave fullscreen mode. This is the default.\r
745 </p>\r
746 </li>\r
747 </ol></div>\r
748 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
749 <div class="listingblock">\r
750 <div class="content">\r
751 <pre><tt>popup_during_fullscreen &lt;ignore|leave_fullscreen&gt;</tt></pre>\r
752 </div></div>\r
753 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
754 <div class="listingblock">\r
755 <div class="content">\r
756 <pre><tt>popup_during_fullscreen ignore</tt></pre>\r
757 </div></div>\r
758 </div>\r
759 <div class="sect2">\r
760 <h3 id="_focus_wrapping">4.17. Focus wrapping</h3>\r
761 <div class="paragraph"><p>When being in a tabbed or stacked container, the first container will be\r
762 focused when you use <tt>focus down</tt> on the last container&#8201;&#8212;&#8201;the focus wraps. If\r
763 however there is another stacked/tabbed container in that direction, focus will\r
764 be set on that container. This is the default behaviour so you can navigate to\r
765 all your windows without having to use <tt>focus parent</tt>.</p></div>\r
766 <div class="paragraph"><p>If you want the focus to <strong>always</strong> wrap and you are aware of using <tt>focus\r
767 parent</tt> to switch to different containers, you can use the\r
768 <tt>force_focus_wrapping</tt> configuration directive. After enabling it, the focus\r
769 will always wrap.</p></div>\r
770 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
771 <div class="listingblock">\r
772 <div class="content">\r
773 <pre><tt>force_focus_wrapping &lt;yes|no&gt;</tt></pre>\r
774 </div></div>\r
775 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
776 <div class="listingblock">\r
777 <div class="content">\r
778 <pre><tt>force_focus_wrapping yes</tt></pre>\r
779 </div></div>\r
780 </div>\r
781 </div>\r
782 </div>\r
783 <div class="sect1">\r
784 <h2 id="_list_of_commands">5. List of commands</h2>\r
785 <div class="sectionbody">\r
786 <div class="paragraph"><p>Commands are what you bind to specific keypresses. You can also issue commands\r
787 at runtime without pressing a key by using the IPC interface. An easy way to\r
788 do this is to use the <tt>i3-msg</tt> utility:</p></div>\r
789 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
790 <div class="listingblock">\r
791 <div class="content">\r
792 <pre><tt># execute this on your shell to make the current container borderless\r
793 i3-msg border none</tt></pre>\r
794 </div></div>\r
795 <div class="paragraph"><p>Commands can be chained by using <tt>;</tt> (a semicolon). So, to move a window to a\r
796 specific workspace and immediately switch to that workspace, you can configure\r
797 the following keybinding:</p></div>\r
798 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
799 <div class="listingblock">\r
800 <div class="content">\r
801 <pre><tt>bindsym mod+x move workspace 3; workspace 3</tt></pre>\r
802 </div></div>\r
803 <div class="paragraph" id="command_criteria"><p>Furthermore, you can change the scope of a command, that is, which containers\r
804 should be affected by that command, by using various criteria. These are\r
805 prefixed in square brackets to every command. If you want to kill all windows\r
806 which have the class Firefox, use:</p></div>\r
807 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
808 <div class="listingblock">\r
809 <div class="content">\r
810 <pre><tt>bindsym mod+x [class="Firefox"] kill</tt></pre>\r
811 </div></div>\r
812 <div class="paragraph"><p>The criteria which are currently implemented are:</p></div>\r
813 <div class="dlist"><dl>\r
814 <dt class="hdlist1">\r
815 class\r
816 </dt>\r
817 <dd>\r
818 <p>\r
819         Compares the window class (the second part of WM_CLASS)\r
820 </p>\r
821 </dd>\r
822 <dt class="hdlist1">\r
823 instance\r
824 </dt>\r
825 <dd>\r
826 <p>\r
827         Compares the window instance (the first part of WM_CLASS)\r
828 </p>\r
829 </dd>\r
830 <dt class="hdlist1">\r
831 id\r
832 </dt>\r
833 <dd>\r
834 <p>\r
835         Compares the X11 window ID, which you can get via <tt>xwininfo</tt> for example.\r
836 </p>\r
837 </dd>\r
838 <dt class="hdlist1">\r
839 title\r
840 </dt>\r
841 <dd>\r
842 <p>\r
843         Compares the X11 window title (_NET_WM_NAME or WM_NAME as fallback).\r
844 </p>\r
845 </dd>\r
846 <dt class="hdlist1">\r
847 mark\r
848 </dt>\r
849 <dd>\r
850 <p>\r
851         Compares the mark set for this container, see <a href="#vim_like_marks">[vim_like_marks]</a>.\r
852 </p>\r
853 </dd>\r
854 <dt class="hdlist1">\r
855 con_id\r
856 </dt>\r
857 <dd>\r
858 <p>\r
859         Compares the i3-internal container ID, which you can get via the IPC\r
860         interface. Handy for scripting.\r
861 </p>\r
862 </dd>\r
863 </dl></div>\r
864 <div class="paragraph"><p>Note that currently all criteria are compared case-insensitive and do not\r
865 support regular expressions. This is planned to change in the future.</p></div>\r
866 <div class="sect2">\r
867 <h3 id="_splitting_containers">5.1. Splitting containers</h3>\r
868 <div class="paragraph"><p>The split command makes the current window a split container. Split containers\r
869 can contain multiple windows. Every split container has an orientation, it is\r
870 either split horizontally (a new window gets placed to the right of the current\r
871 one) or vertically (a new window gets placed below the current one).</p></div>\r
872 <div class="paragraph"><p>If you apply this command to a split container with the same orientation,\r
873 nothing will happen. If you use a different orientation, the split container’s\r
874 orientation will be changed (if it does not have more than one window).</p></div>\r
875 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
876 <div class="listingblock">\r
877 <div class="content">\r
878 <pre><tt>split &lt;vertical|horizontal&gt;</tt></pre>\r
879 </div></div>\r
880 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
881 <div class="listingblock">\r
882 <div class="content">\r
883 <pre><tt>bindsym mod+v split vertical\r
884 bindsym mod+h split horizontal</tt></pre>\r
885 </div></div>\r
886 </div>\r
887 <div class="sect2">\r
888 <h3 id="_manipulating_layout">5.2. Manipulating layout</h3>\r
889 <div class="paragraph"><p>Use <tt>layout default</tt>, <tt>layout stacking</tt> or <tt>layout tabbed</tt> to change the\r
890 current container layout to default, stacking or tabbed layout, respectively.</p></div>\r
891 <div class="paragraph"><p>To make the current window (!) fullscreen, use <tt>fullscreen</tt>, to make\r
892 it floating (or tiling again) use <tt>floating enable</tt> respectively <tt>floating disable</tt>\r
893 (or <tt>floating toggle</tt>):</p></div>\r
894 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
895 <div class="listingblock">\r
896 <div class="content">\r
897 <pre><tt>bindsym mod+s layout stacking\r
898 bindsym mod+l layout default\r
899 bindsym mod+w layout tabbed\r
900 \r
901 # Toggle fullscreen\r
902 bindsym mod+f fullscreen\r
903 \r
904 # Toggle floating/tiling\r
905 bindsym mod+t floating toggle</tt></pre>\r
906 </div></div>\r
907 </div>\r
908 <div class="sect2">\r
909 <h3 id="_focusing_moving_containers">5.3. Focusing/Moving containers</h3>\r
910 <div class="paragraph"><p>To change the focus, use the focus command: <tt>focus left</tt>, <tt>focus right</tt>, <tt>focus down</tt> and <tt>focus up</tt>.</p></div>\r
911 <div class="paragraph"><p>There are a few special parameters you can use for the focus command:</p></div>\r
912 <div class="dlist"><dl>\r
913 <dt class="hdlist1">\r
914 parent\r
915 </dt>\r
916 <dd>\r
917 <p>\r
918         Sets focus to the <tt>Parent Container</tt> of the current <tt>Container</tt>.\r
919 </p>\r
920 </dd>\r
921 <dt class="hdlist1">\r
922 child\r
923 </dt>\r
924 <dd>\r
925 <p>\r
926         The opposite of <tt>focus parent</tt>, sets the focus to the last focused\r
927         child container.\r
928 </p>\r
929 </dd>\r
930 <dt class="hdlist1">\r
931 floating\r
932 </dt>\r
933 <dd>\r
934 <p>\r
935         Sets focus to the last focused floating container.\r
936 </p>\r
937 </dd>\r
938 <dt class="hdlist1">\r
939 tiling\r
940 </dt>\r
941 <dd>\r
942 <p>\r
943         Sets focus to the last focused tiling container.\r
944 </p>\r
945 </dd>\r
946 <dt class="hdlist1">\r
947 mode_toggle\r
948 </dt>\r
949 <dd>\r
950 <p>\r
951         Toggles between floating/tiling containers.\r
952 </p>\r
953 </dd>\r
954 </dl></div>\r
955 <div class="paragraph"><p>For moving, use <tt>move left</tt>, <tt>move right</tt>, <tt>move down</tt> and <tt>move up</tt>.</p></div>\r
956 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
957 <div class="listingblock">\r
958 <div class="content">\r
959 <pre><tt># Focus clients on the left, bottom, top, right:\r
960 bindsym mod+j focus left\r
961 bindsym mod+k focus down\r
962 bindsym mod+l focus up\r
963 bindsym mod+semicolon focus right\r
964 \r
965 # Focus parent container\r
966 bindsym mod+u focus parent\r
967 \r
968 # Focus last floating/tiling container\r
969 bindsym mod+g focus mode_toggle\r
970 \r
971 # Move client to the left, bottom, top, right:\r
972 bindsym mod+j move left\r
973 bindsym mod+k move down\r
974 bindsym mod+l move up\r
975 bindsym mod+semicolon move right</tt></pre>\r
976 </div></div>\r
977 </div>\r
978 <div class="sect2">\r
979 <h3 id="_changing_named_workspaces_moving_to_workspaces">5.4. Changing (named) workspaces/moving to workspaces</h3>\r
980 <div class="paragraph"><p>To change to a specific workspace, use the <tt>workspace</tt> command, followed by the\r
981 number or name of the workspace. To move containers to specific workspaces, use\r
982 <tt>move workspace</tt>.</p></div>\r
983 <div class="paragraph"><p>You can also switch to the next and previous workspace with the commands\r
984 <tt>workspace next</tt> and <tt>workspace prev</tt>, which is handy, for example, if you have\r
985 workspace 1, 3, 4 and 9 and you want to cycle through them with a single key\r
986 combination.</p></div>\r
987 <div class="paragraph"><p>To move a container to another xrandr output such as <tt>LVDS1</tt> or <tt>VGA1</tt>, you can\r
988 use the <tt>move output</tt> command followed by the name of the target output. You\r
989 may also use <tt>left</tt>, <tt>right</tt>, <tt>up</tt>, <tt>down</tt> instead of the xrandr output name to\r
990 move to the the next output in the specified direction.</p></div>\r
991 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
992 <div class="listingblock">\r
993 <div class="content">\r
994 <pre><tt>bindsym mod+1 workspace 1\r
995 bindsym mod+2 workspace 2\r
996 ...\r
997 \r
998 bindsym mod+Shift+1 move workspace 1\r
999 bindsym mod+Shift+2 move workspace 2\r
1000 ...</tt></pre>\r
1001 </div></div>\r
1002 <div class="sect3">\r
1003 <h4 id="_named_workspaces">5.4.1. Named workspaces</h4>\r
1004 <div class="paragraph"><p>Workspaces are identified by their name. So, instead of using numbers in the\r
1005 workspace command, you can use an arbitrary name:</p></div>\r
1006 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1007 <div class="listingblock">\r
1008 <div class="content">\r
1009 <pre><tt>bindsym mod+1 workspace mail\r
1010 ...</tt></pre>\r
1011 </div></div>\r
1012 <div class="paragraph"><p>If you want the workspace to have a number <strong>and</strong> a name, just prefix the\r
1013 number, like this:</p></div>\r
1014 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1015 <div class="listingblock">\r
1016 <div class="content">\r
1017 <pre><tt>bindsym mod+1 workspace 1: mail\r
1018 bindsym mod+2 workspace 2: www\r
1019 ...</tt></pre>\r
1020 </div></div>\r
1021 <div class="paragraph"><p>Note that the workspace will really be named "1: mail". i3 treats workspace\r
1022 names beginning with a number in a slightly special way. Normally, named\r
1023 workspaces are ordered the way they appeared. When they start with a number, i3\r
1024 will order them numerically.</p></div>\r
1025 </div>\r
1026 </div>\r
1027 <div class="sect2">\r
1028 <h3 id="resizingconfig">5.5. Resizing containers/windows</h3>\r
1029 <div class="paragraph"><p>If you want to resize containers/windows using your keyboard, you can use the\r
1030 <tt>resize</tt> command:</p></div>\r
1031 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1032 <div class="listingblock">\r
1033 <div class="content">\r
1034 <pre><tt>resize &lt;grow|shrink&gt; &lt;direction&gt; [&lt;px&gt; px] [or &lt;ppt&gt; ppt]</tt></pre>\r
1035 </div></div>\r
1036 <div class="paragraph"><p>Direction can be one of <tt>up</tt>, <tt>down</tt>, <tt>left</tt> or <tt>right</tt>. The optional pixel\r
1037 argument specifies by how many pixels a <strong>floating container</strong> should be grown or\r
1038 shrinked (the default is 10 pixels). The ppt argument means percentage points\r
1039 and specifies by how many percentage points a <strong>tiling container</strong> should be\r
1040 grown or shrinked (the default is 10 percentage points).</p></div>\r
1041 <div class="paragraph"><p>I recommend using the resize command inside a so called <tt>mode</tt>:</p></div>\r
1042 <div class="listingblock">\r
1043 <div class="title">Example: Configuration file, defining a mode for resizing</div>\r
1044 <div class="content">\r
1045 <pre><tt>mode "resize" {\r
1046         # These bindings trigger as soon as you enter the resize mode\r
1047 \r
1048         # They resize the border in the direction you pressed, e.g.\r
1049         # when pressing left, the window is resized so that it has\r
1050         # more space on its left\r
1051 \r
1052         bindsym j resize shrink left\r
1053         bindsym Shift+j resize grow left\r
1054 \r
1055         bindsym k resize grow down\r
1056         bindsym Shift+k resize shrink down\r
1057 \r
1058         bindsym l resize shrink up\r
1059         bindsym Shift+l resize grow up\r
1060 \r
1061         bindsym semicolon resize grow right\r
1062         bindsym Shift+semicolon resize shrink right\r
1063 \r
1064         # back to normal: Enter or Escape\r
1065         bindsym Return mode "default"\r
1066         bindsym Escape mode "default"\r
1067 }\r
1068 \r
1069 # Enter resize mode\r
1070 bindsym mod+r mode "resize"</tt></pre>\r
1071 </div></div>\r
1072 </div>\r
1073 <div class="sect2">\r
1074 <h3 id="_jumping_to_specific_windows">5.6. Jumping to specific windows</h3>\r
1075 <div class="paragraph"><p>Often when in a multi-monitor environment, you want to quickly jump to a\r
1076 specific window. For example, while working on workspace 3 you may want to\r
1077 jump to your mail client to email your boss that you’ve achieved some\r
1078 important goal. Instead of figuring out how to navigate to your mailclient,\r
1079 it would be more convenient to have a shortcut. You can use the <tt>focus</tt> command\r
1080 with criteria for that.</p></div>\r
1081 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1082 <div class="listingblock">\r
1083 <div class="content">\r
1084 <pre><tt>[class="class"] focus\r
1085 [title="title"] focus</tt></pre>\r
1086 </div></div>\r
1087 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
1088 <div class="listingblock">\r
1089 <div class="content">\r
1090 <pre><tt># Get me to the next open VIM instance\r
1091 bindsym mod+a [class="urxvt" title="VIM"] focus</tt></pre>\r
1092 </div></div>\r
1093 </div>\r
1094 <div class="sect2">\r
1095 <h3 id="_vim_like_marks_mark_goto">5.7. VIM-like marks (mark/goto)</h3>\r
1096 <div class="paragraph" id="vim_like_marks"><p>This feature is like the jump feature: It allows you to directly jump to a\r
1097 specific window (this means switching to the appropriate workspace and setting\r
1098 focus to the windows). However, you can directly mark a specific window with\r
1099 an arbitrary label and use it afterwards.  You do not need to ensure that your\r
1100 windows have unique classes or titles, and you do not need to change your\r
1101 configuration file.</p></div>\r
1102 <div class="paragraph"><p>As the command needs to include the label with which you want to mark the\r
1103 window, you cannot simply bind it to a key.  <tt>i3-input</tt> is a tool created\r
1104 for this purpose: It lets you input a command and sends the command to i3. It\r
1105 can also prefix this command and display a custom prompt for the input dialog.</p></div>\r
1106 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1107 <div class="listingblock">\r
1108 <div class="content">\r
1109 <pre><tt>mark identifier\r
1110 [con_mark="identifier"] focus</tt></pre>\r
1111 </div></div>\r
1112 <div class="paragraph"><p><strong>Example (in a terminal)</strong>:</p></div>\r
1113 <div class="listingblock">\r
1114 <div class="content">\r
1115 <pre><tt>$ i3-msg mark irssi\r
1116 $ i3-msg '[con_mark="irssi"] focus'</tt></pre>\r
1117 </div></div>\r
1118 </div>\r
1119 <div class="sect2">\r
1120 <h3 id="_changing_border_style">5.8. Changing border style</h3>\r
1121 <div class="paragraph"><p>To change the border of the current client, you can use <tt>border normal</tt> to use the normal\r
1122 border (including window title), <tt>border 1pixel</tt> to use a 1-pixel border (no window title)\r
1123 and <tt>border none</tt> to make the client borderless.</p></div>\r
1124 <div class="paragraph"><p>There is also <tt>border toggle</tt> which will toggle the different border styles.</p></div>\r
1125 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
1126 <div class="listingblock">\r
1127 <div class="content">\r
1128 <pre><tt>bindsym mod+t border normal\r
1129 bindsym mod+y border 1pixel\r
1130 bindsym mod+u border none</tt></pre>\r
1131 </div></div>\r
1132 </div>\r
1133 <div class="sect2">\r
1134 <h3 id="stack-limit">5.9. Reloading/Restarting/Exiting</h3>\r
1135 <div class="paragraph"><p>You can make i3 reload its configuration file with <tt>reload</tt>. You can also\r
1136 restart i3 inplace with the <tt>restart</tt> command to get it out of some weird state\r
1137 (if that should ever happen) or to perform an upgrade without having to restart\r
1138 your X session. To exit i3 properly, you can use the <tt>exit</tt> command,\r
1139 however you don’t need to (simply killing your X session is fine as well).</p></div>\r
1140 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
1141 <div class="listingblock">\r
1142 <div class="content">\r
1143 <pre><tt>bindsym mod+Shift+r restart\r
1144 bindsym mod+Shift+w reload\r
1145 bindsym mod+Shift+e exit</tt></pre>\r
1146 </div></div>\r
1147 </div>\r
1148 </div>\r
1149 </div>\r
1150 <div class="sect1">\r
1151 <h2 id="multi_monitor">6. Multiple monitors</h2>\r
1152 <div class="sectionbody">\r
1153 <div class="paragraph"><p>As you can see in the goal list on the website, i3 was specifically developed\r
1154 with support for multiple monitors in mind. This section will explain how to\r
1155 handle multiple monitors.</p></div>\r
1156 <div class="paragraph"><p>When you have only one monitor, things are simple. You usually start with\r
1157 workspace 1 on your monitor and open new ones as you need them.</p></div>\r
1158 <div class="paragraph"><p>When you have more than one monitor, each monitor will get an initial\r
1159 workspace.  The first monitor gets 1, the second gets 2 and a possible third\r
1160 would get 3. When you switch to a workspace on a different monitor, i3 will\r
1161 switch to that monitor and then switch to the workspace. This way, you don’t\r
1162 need shortcuts to switch to a specific monitor, and you don’t need to remember\r
1163 where you put which workspace. New workspaces will be opened on the currently\r
1164 active monitor.  It is not possible to have a monitor without a workspace.</p></div>\r
1165 <div class="paragraph"><p>The idea of making workspaces global is based on the observation that most\r
1166 users have a very limited set of workspaces on their additional monitors.\r
1167 They are often used for a specific task (browser, shell) or for monitoring\r
1168 several things (mail, IRC, syslog, …). Thus, using one workspace on one monitor\r
1169 and "the rest" on the other monitors often makes sense. However, as you can\r
1170 create an unlimited number of workspaces in i3 and tie them to specific\r
1171 screens, you can have the "traditional" approach of having X workspaces per\r
1172 screen by changing your configuration (using modes, for example).</p></div>\r
1173 <div class="sect2">\r
1174 <h3 id="_configuring_your_monitors">6.1. Configuring your monitors</h3>\r
1175 <div class="paragraph"><p>To help you get going if you have never used multiple monitors before, here is\r
1176 a short overview of the xrandr options which will probably be of interest to\r
1177 you. It is always useful to get an overview of the current screen configuration.\r
1178 Just run "xrandr" and you will get an output like the following:</p></div>\r
1179 <div class="listingblock">\r
1180 <div class="content">\r
1181 <pre><tt>$ xrandr\r
1182 Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192\r
1183 VGA1 disconnected (normal left inverted right x axis y axis)\r
1184 LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm\r
1185    1280x800       60.0*+   50.0\r
1186    1024x768       85.0     75.0     70.1     60.0\r
1187    832x624        74.6\r
1188    800x600        85.1     72.2     75.0     60.3     56.2\r
1189    640x480        85.0     72.8     75.0     59.9\r
1190    720x400        85.0\r
1191    640x400        85.1\r
1192    640x350        85.1</tt></pre>\r
1193 </div></div>\r
1194 <div class="paragraph"><p>Several things are important here: You can see that <tt>LVDS1</tt> is connected (of\r
1195 course, it is the internal flat panel) but <tt>VGA1</tt> is not. If you have a monitor\r
1196 connected to one of the ports but xrandr still says "disconnected", you should\r
1197 check your cable, monitor or graphics driver.</p></div>\r
1198 <div class="paragraph"><p>The maximum resolution you can see at the end of the first line is the maximum\r
1199 combined resolution of your monitors. By default, it is usually too low and has\r
1200 to be increased by editing <tt>/etc/X11/xorg.conf</tt>.</p></div>\r
1201 <div class="paragraph"><p>So, say you connected VGA1 and want to use it as an additional screen:</p></div>\r
1202 <div class="listingblock">\r
1203 <div class="content">\r
1204 <pre><tt>xrandr --output VGA1 --auto --left-of LVDS1</tt></pre>\r
1205 </div></div>\r
1206 <div class="paragraph"><p>This command makes xrandr try to find the native resolution of the device\r
1207 connected to <tt>VGA1</tt> and configures it to the left of your internal flat panel.\r
1208 When running "xrandr" again, the output looks like this:</p></div>\r
1209 <div class="listingblock">\r
1210 <div class="content">\r
1211 <pre><tt>$ xrandr\r
1212 Screen 0: minimum 320 x 200, current 2560 x 1024, maximum 8192 x 8192\r
1213 VGA1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm\r
1214    1280x1024      60.0*+   75.0\r
1215    1280x960       60.0\r
1216    1152x864       75.0\r
1217    1024x768       75.1     70.1     60.0\r
1218    832x624        74.6\r
1219    800x600        72.2     75.0     60.3     56.2\r
1220    640x480        72.8     75.0     66.7     60.0\r
1221    720x400        70.1\r
1222 LVDS1 connected 1280x800+1280+0 (normal left inverted right x axis y axis) 261mm x 163mm\r
1223    1280x800       60.0*+   50.0\r
1224    1024x768       85.0     75.0     70.1     60.0\r
1225    832x624        74.6\r
1226    800x600        85.1     72.2     75.0     60.3     56.2\r
1227    640x480        85.0     72.8     75.0     59.9\r
1228    720x400        85.0\r
1229    640x400        85.1\r
1230    640x350        85.1</tt></pre>\r
1231 </div></div>\r
1232 <div class="paragraph"><p>Please note that i3 uses exactly the same API as xrandr does, so it will see\r
1233 only what you can see in xrandr.</p></div>\r
1234 <div class="paragraph"><p>See also <a href="#presentations">[presentations]</a> for more examples of multi-monitor setups.</p></div>\r
1235 </div>\r
1236 <div class="sect2">\r
1237 <h3 id="_interesting_configuration_for_multi_monitor_environments">6.2. Interesting configuration for multi-monitor environments</h3>\r
1238 <div class="paragraph"><p>There are several things to configure in i3 which may be interesting if you\r
1239 have more than one monitor:</p></div>\r
1240 <div class="olist arabic"><ol class="arabic">\r
1241 <li>\r
1242 <p>\r
1243 You can specify which workspace should be put on which screen. This\r
1244    allows you to have a different set of workspaces when starting than just\r
1245    1 for the first monitor, 2 for the second and so on. See\r
1246    <a href="#workspace_screen">[workspace_screen]</a>.\r
1247 </p>\r
1248 </li>\r
1249 <li>\r
1250 <p>\r
1251 If you want some applications to generally open on the bigger screen\r
1252    (MPlayer, Firefox, …), you can assign them to a specific workspace, see\r
1253    <a href="#assign_workspace">[assign_workspace]</a>.\r
1254 </p>\r
1255 </li>\r
1256 <li>\r
1257 <p>\r
1258 If you have many workspaces on many monitors, it might get hard to keep\r
1259    track of which window you put where. Thus, you can use vim-like marks to\r
1260    quickly switch between windows. See <a href="#vim_like_marks">[vim_like_marks]</a>.\r
1261 </p>\r
1262 </li>\r
1263 </ol></div>\r
1264 </div>\r
1265 </div>\r
1266 </div>\r
1267 <div class="sect1">\r
1268 <h2 id="_i3_and_the_rest_of_your_software_world">7. i3 and the rest of your software world</h2>\r
1269 <div class="sectionbody">\r
1270 <div class="sect2">\r
1271 <h3 id="_displaying_a_status_line">7.1. Displaying a status line</h3>\r
1272 <div class="paragraph"><p>A very common thing amongst users of exotic window managers is a status line at\r
1273 some corner of the screen. It is an often superior replacement to the widget\r
1274 approach you have in the task bar of a traditional desktop environment.</p></div>\r
1275 <div class="paragraph"><p>If you don’t already have your favorite way of generating such a status line\r
1276 (self-written scripts, conky, …), then i3status is the recommended tool for\r
1277 this task. It was written in C with the goal of using as few syscalls as\r
1278 possible to reduce the time your CPU is woken up from sleep states. Because\r
1279 i3status only spits out text, you need to combine it with some other tool, like\r
1280 i3bar. Use a pipe to connect them: <tt>i3status | i3bar -d</tt>.</p></div>\r
1281 <div class="paragraph"><p>Regardless of which application you use to display the status line, you\r
1282 want to make sure that it registers as a dock window using EWMH hints. i3 will\r
1283 position the window either at the top or at the bottom of the screen, depending\r
1284 on which hint the application sets. With i3bar, you can use <tt>-d</tt> or <tt>-dbottom</tt>\r
1285 for positioning it at the bottom and <tt>-dtop</tt> to position it at the top of the\r
1286 screen.</p></div>\r
1287 </div>\r
1288 <div class="sect2">\r
1289 <h3 id="_giving_presentations_multi_monitor">7.2. Giving presentations (multi-monitor)</h3>\r
1290 <div class="paragraph"><p>When giving a presentation, you typically want the audience to see what you see\r
1291 on your screen and then go through a series of slides (if the presentation is\r
1292 simple). For more complex presentations, you might want to have some notes\r
1293 which only you can see on your screen, while the audience can only see the\r
1294 slides.</p></div>\r
1295 <div class="sect3">\r
1296 <h4 id="presentations">7.2.1. Case 1: everybody gets the same output</h4>\r
1297 <div class="paragraph"><p>This is the simple case. You connect your computer to the video projector,\r
1298 turn on both (computer and video projector) and configure your X server to\r
1299 clone the internal flat panel of your computer to the video output:</p></div>\r
1300 <div class="listingblock">\r
1301 <div class="content">\r
1302 <pre><tt>xrandr --output VGA1 --mode 1024x768 --same-as LVDS1</tt></pre>\r
1303 </div></div>\r
1304 <div class="paragraph"><p>i3 will then use the lowest common subset of screen resolutions, the rest of\r
1305 your screen will be left untouched (it will show the X background). So, in\r
1306 our example, this would be 1024x768 (my notebook has 1280x800).</p></div>\r
1307 </div>\r
1308 <div class="sect3">\r
1309 <h4 id="_case_2_you_can_see_more_than_your_audience">7.2.2. Case 2: you can see more than your audience</h4>\r
1310 <div class="paragraph"><p>This case is a bit harder. First of all, you should configure the VGA output\r
1311 somewhere near your internal flat panel, say right of it:</p></div>\r
1312 <div class="listingblock">\r
1313 <div class="content">\r
1314 <pre><tt>xrandr --output VGA1 --mode 1024x768 --right-of LVDS1</tt></pre>\r
1315 </div></div>\r
1316 <div class="paragraph"><p>Now, i3 will put a new workspace (depending on your settings) on the new screen\r
1317 and you are in multi-monitor mode (see <a href="#multi_monitor">[multi_monitor]</a>).</p></div>\r
1318 <div class="paragraph"><p>Because i3 is not a compositing window manager, there is no ability to\r
1319 display a window on two screens at the same time. Instead, your presentation\r
1320 software needs to do this job (that is, open a window on each screen).</p></div>\r
1321 </div>\r
1322 </div>\r
1323 </div>\r
1324 </div>\r
1325 </div>\r
1326 <div id="footnotes"><hr /></div>\r
1327 <div id="footer" lang="de">\r
1328 © 2009-2011 Michael Stapelberg, <a href="/impress.html">Impressum</a>\r
1329 </div>\r
1330 </body>\r
1331 </html>\r