]> git.sur5r.net Git - i3/i3.github.io/blob - docs/userguide.html
update docs for 4.1
[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">October 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 (the aspect\r
440 ratio will be preserved).</p></div>\r
441 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
442 <div class="listingblock">\r
443 <div class="content">\r
444 <pre><tt>floating_modifier &lt;Modifiers&gt;</tt></pre>\r
445 </div></div>\r
446 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
447 <div class="listingblock">\r
448 <div class="content">\r
449 <pre><tt>floating_modifier Mod1</tt></pre>\r
450 </div></div>\r
451 </div>\r
452 <div class="sect2">\r
453 <h3 id="_orientation_for_new_workspaces">4.5. Orientation for new workspaces</h3>\r
454 <div class="paragraph"><p>New workspaces get a reasonable default orientation: Wide-screen monitors\r
455 (anything wider than high) get horizontal orientation, rotated monitors\r
456 (anything higher than wide) get vertical orientation.</p></div>\r
457 <div class="paragraph"><p>With the <tt>default_orientation</tt> configuration directive, you can override that\r
458 behaviour.</p></div>\r
459 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
460 <div class="listingblock">\r
461 <div class="content">\r
462 <pre><tt>default_orientation &lt;horizontal|vertical|auto&gt;</tt></pre>\r
463 </div></div>\r
464 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
465 <div class="listingblock">\r
466 <div class="content">\r
467 <pre><tt>default_orientation vertical</tt></pre>\r
468 </div></div>\r
469 </div>\r
470 <div class="sect2">\r
471 <h3 id="_layout_mode_for_new_containers">4.6. Layout mode for new containers</h3>\r
472 <div class="paragraph"><p>This option determines in which mode new containers on workspace level will\r
473 start.</p></div>\r
474 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
475 <div class="listingblock">\r
476 <div class="content">\r
477 <pre><tt>workspace_layout &lt;default|stacking|tabbed&gt;</tt></pre>\r
478 </div></div>\r
479 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
480 <div class="listingblock">\r
481 <div class="content">\r
482 <pre><tt>workspace_layout tabbed</tt></pre>\r
483 </div></div>\r
484 </div>\r
485 <div class="sect2">\r
486 <h3 id="_border_style_for_new_windows">4.7. Border style for new windows</h3>\r
487 <div class="paragraph"><p>This option determines which border style new windows will have.</p></div>\r
488 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
489 <div class="listingblock">\r
490 <div class="content">\r
491 <pre><tt>new_window &lt;normal|1pixel|none&gt;</tt></pre>\r
492 </div></div>\r
493 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
494 <div class="listingblock">\r
495 <div class="content">\r
496 <pre><tt>new_window 1pixel</tt></pre>\r
497 </div></div>\r
498 </div>\r
499 <div class="sect2">\r
500 <h3 id="_arbitrary_commands_for_specific_windows_for_window">4.8. Arbitrary commands for specific windows (for_window)</h3>\r
501 <div class="paragraph"><p>With the <tt>for_window</tt> command, you can let i3 execute any command when it\r
502 encounters a specific window. This can be used to set windows to floating or to\r
503 change their border style, for example.</p></div>\r
504 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
505 <div class="listingblock">\r
506 <div class="content">\r
507 <pre><tt>for_window &lt;criteria&gt; command</tt></pre>\r
508 </div></div>\r
509 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
510 <div class="listingblock">\r
511 <div class="content">\r
512 <pre><tt># enable floating mode for all XTerm windows\r
513 for_window [class="XTerm"] floating enable\r
514 \r
515 # Make all urxvts use a 1-pixel border:\r
516 for_window [class="urxvt"] border 1pixel\r
517 \r
518 # A less useful, but rather funny example:\r
519 # makes the window floating as soon as I change\r
520 # directory to ~/work\r
521 for_window [title="x200: ~/work"] floating enable</tt></pre>\r
522 </div></div>\r
523 <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
524 </div>\r
525 <div class="sect2">\r
526 <h3 id="_variables">4.9. Variables</h3>\r
527 <div class="paragraph"><p>As you learned in the section about keyboard bindings, you will have\r
528 to configure lots of bindings containing modifier keys. If you want to save\r
529 yourself some typing and be able to change the modifier you use later,\r
530 variables can be handy.</p></div>\r
531 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
532 <div class="listingblock">\r
533 <div class="content">\r
534 <pre><tt>set $name value</tt></pre>\r
535 </div></div>\r
536 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
537 <div class="listingblock">\r
538 <div class="content">\r
539 <pre><tt>set $m Mod1\r
540 bindsym $m+Shift+r restart</tt></pre>\r
541 </div></div>\r
542 <div class="paragraph"><p>Variables are directly replaced in the file when parsing. There is no fancy\r
543 handling and there are absolutely no plans to change this. If you need a more\r
544 dynamic configuration you should create a little script which generates a\r
545 configuration file and run it before starting i3 (for example in your\r
546 <tt>~/.xsession</tt> file).</p></div>\r
547 </div>\r
548 <div class="sect2">\r
549 <h3 id="_automatically_putting_clients_on_specific_workspaces">4.10. Automatically putting clients on specific workspaces</h3>\r
550 <div class="paragraph" id="assign_workspace"><p>To automatically make a specific window show up on a specific workspace, you\r
551 can use an <strong>assignment</strong>. You can match windows by using any criteria,\r
552 see <a href="#command_criteria">[command_criteria]</a>. It is recommended that you match on window classes\r
553 (and instances, when appropriate) instead of window titles whenever possible\r
554 because some applications first create their window, and then worry about\r
555 setting the correct title. Firefox with Vimperator comes to mind. The window\r
556 starts up being named Firefox, and only when Vimperator is loaded does the\r
557 title change. As i3 will get the title as soon as the application maps the\r
558 window (mapping means actually displaying it on the screen), you’d need to have\r
559 to match on <em>Firefox</em> in this case.</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 &lt;criteria&gt; [→] 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 terminals to workspace 2\r
569 assign [class="URxvt"] 2\r
570 \r
571 # Same thing, but more precise (exact match instead of substring)\r
572 assign [class="^URxvt$"] 2\r
573 \r
574 # Same thing, but with a beautiful arrow :)\r
575 assign [class="^URxvt$"] → 2\r
576 \r
577 # Assignment to a named workspace\r
578 assign [class="^URxvt$"] → work\r
579 \r
580 # Start urxvt -name irssi\r
581 assign [class="^URxvt$" instance="^irssi$"] → 3</tt></pre>\r
582 </div></div>\r
583 <div class="paragraph"><p>Note that the arrow is not required, it just looks good :-). If you decide to\r
584 use it, it has to be a UTF-8 encoded arrow, not <tt>-&gt;</tt> or something like that.</p></div>\r
585 <div class="paragraph"><p>To get the class and instance, you can use <tt>xprop</tt>. After clicking on the\r
586 window, you will see the following output:</p></div>\r
587 <div class="paragraph"><p><strong>xwininfo</strong>:</p></div>\r
588 <div class="listingblock">\r
589 <div class="content">\r
590 <pre><tt>WM_CLASS(STRING) = "irssi", "URxvt"</tt></pre>\r
591 </div></div>\r
592 <div class="paragraph"><p>The first part of the WM_CLASS is the instance ("irssi" in this example), the\r
593 second part is the class ("URxvt" in this example).</p></div>\r
594 <div class="paragraph"><p>Should you have any problems with assignments, make sure to check the i3\r
595 logfile first (see <a href="http://i3wm.org/docs/debugging.html">http://i3wm.org/docs/debugging.html</a>). It includes more\r
596 details about the matching process and the window’s actual class, instance and\r
597 title when starting up.</p></div>\r
598 </div>\r
599 <div class="sect2">\r
600 <h3 id="_automatically_starting_applications_on_i3_startup">4.11. Automatically starting applications on i3 startup</h3>\r
601 <div class="paragraph"><p>By using the <tt>exec</tt> keyword outside a keybinding, you can configure\r
602 which commands will be performed by i3 on initial startup. <tt>exec</tt>\r
603 commands will not run when restarting i3, if you need a command to run\r
604 also when restarting i3 you should use the <tt>exec_always</tt>\r
605 keyword. These commands will be run in order.</p></div>\r
606 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
607 <div class="listingblock">\r
608 <div class="content">\r
609 <pre><tt>exec [--no-startup-id] command\r
610 exec_always [--no-startup-id] command</tt></pre>\r
611 </div></div>\r
612 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
613 <div class="listingblock">\r
614 <div class="content">\r
615 <pre><tt>exec chromium\r
616 exec_always ~/my_script.sh\r
617 \r
618 # Execute the terminal emulator urxvt, which is not yet startup-notification aware.\r
619 exec --no-startup-id urxvt</tt></pre>\r
620 </div></div>\r
621 <div class="paragraph"><p>The flag --no-startup-id is explained in <a href="#exec">[exec]</a>.</p></div>\r
622 </div>\r
623 <div class="sect2">\r
624 <h3 id="workspace_screen">4.12. Automatically putting workspaces on specific screens</h3>\r
625 <div class="paragraph"><p>If you assign clients to workspaces, it might be handy to put the\r
626 workspaces on specific screens. Also, the assignment of workspaces to screens\r
627 will determine which workspace i3 uses for a new screen when adding screens\r
628 or when starting (e.g., by default it will use 1 for the first screen, 2 for\r
629 the second screen and so on).</p></div>\r
630 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
631 <div class="listingblock">\r
632 <div class="content">\r
633 <pre><tt>workspace &lt;workspace&gt; output &lt;output&gt;</tt></pre>\r
634 </div></div>\r
635 <div class="paragraph"><p>The <em>output</em> is the name of the RandR output you attach your screen to. On a\r
636 laptop, you might have VGA1 and LVDS1 as output names. You can see the\r
637 available outputs by running <tt>xrandr --current</tt>.</p></div>\r
638 <div class="paragraph"><p>If you use named workspaces, they must be quoted:</p></div>\r
639 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
640 <div class="listingblock">\r
641 <div class="content">\r
642 <pre><tt>workspace 1 output LVDS1\r
643 workspace 5 output VGA1\r
644 workspace "2: vim" output VGA1</tt></pre>\r
645 </div></div>\r
646 </div>\r
647 <div class="sect2">\r
648 <h3 id="_changing_colors">4.13. Changing colors</h3>\r
649 <div class="paragraph"><p>You can change all colors which i3 uses to draw the window decorations.</p></div>\r
650 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
651 <div class="listingblock">\r
652 <div class="content">\r
653 <pre><tt>colorclass border background text</tt></pre>\r
654 </div></div>\r
655 <div class="paragraph"><p>Where colorclass can be one of:</p></div>\r
656 <div class="dlist"><dl>\r
657 <dt class="hdlist1">\r
658 client.focused\r
659 </dt>\r
660 <dd>\r
661 <p>\r
662         A client which currently has the focus.\r
663 </p>\r
664 </dd>\r
665 <dt class="hdlist1">\r
666 client.focused_inactive\r
667 </dt>\r
668 <dd>\r
669 <p>\r
670         A client which is the focused one of its container, but it does not have\r
671         the focus at the moment.\r
672 </p>\r
673 </dd>\r
674 <dt class="hdlist1">\r
675 client.unfocused\r
676 </dt>\r
677 <dd>\r
678 <p>\r
679         A client which is not the focused one of its container.\r
680 </p>\r
681 </dd>\r
682 <dt class="hdlist1">\r
683 client.urgent\r
684 </dt>\r
685 <dd>\r
686 <p>\r
687         A client which has its urgency hint activated.\r
688 </p>\r
689 </dd>\r
690 </dl></div>\r
691 <div class="paragraph"><p>You can also specify the color to be used to paint the background of the client\r
692 windows. This color will be used to paint the window on top of which the client\r
693 will be rendered.</p></div>\r
694 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
695 <div class="listingblock">\r
696 <div class="content">\r
697 <pre><tt>client.background color</tt></pre>\r
698 </div></div>\r
699 <div class="paragraph"><p>Only clients that do not cover the whole area of this window expose the color\r
700 used to paint it. If you use a color other than black for your terminals, you\r
701 most likely want to set the client background color to the same color as your\r
702 terminal program&#8217;s background color to avoid black gaps between the rendered\r
703 area of the termianal and the i3 border.</p></div>\r
704 <div class="paragraph"><p>Colors are in HTML hex format (#rrggbb), see the following example:</p></div>\r
705 <div class="paragraph"><p><strong>Examples (default colors)</strong>:</p></div>\r
706 <div class="listingblock">\r
707 <div class="content">\r
708 <pre><tt># class                 border  backgr. text\r
709 client.focused          #4c7899 #285577 #ffffff\r
710 client.focused_inactive #333333 #5f676a #ffffff\r
711 client.unfocused        #333333 #222222 #888888\r
712 client.urgent           #2f343a #900000 #ffffff</tt></pre>\r
713 </div></div>\r
714 <div class="paragraph"><p>Note that for the window decorations, the color around the child window is the\r
715 background color, and the border color is only the two thin lines at the top of\r
716 the window.</p></div>\r
717 </div>\r
718 <div class="sect2">\r
719 <h3 id="_interprocess_communication">4.14. Interprocess communication</h3>\r
720 <div class="paragraph"><p>i3 uses unix sockets to provide an IPC interface. This allows third-party\r
721 programs to get information from i3, such as the current workspaces\r
722 (to display a workspace bar), and to control i3.</p></div>\r
723 <div class="paragraph"><p>The IPC socket is enabled by default and will be created in\r
724 <tt>/tmp/i3-%u/ipc-socket.%p</tt> where <tt>%u</tt> is your UNIX username and <tt>%p</tt> is the PID\r
725 of i3.</p></div>\r
726 <div class="paragraph"><p>You can override the default path through the environment-variable <tt>I3SOCK</tt> or\r
727 by specifying the <tt>ipc-socket</tt> directive. This is discouraged, though, since i3\r
728 does the right thing by default.</p></div>\r
729 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
730 <div class="listingblock">\r
731 <div class="content">\r
732 <pre><tt>ipc-socket /tmp/i3-ipc.sock</tt></pre>\r
733 </div></div>\r
734 <div class="paragraph"><p>You can then use the <tt>i3-msg</tt> application to perform any command listed in\r
735 the next section.</p></div>\r
736 </div>\r
737 <div class="sect2">\r
738 <h3 id="_focus_follows_mouse">4.15. Focus follows mouse</h3>\r
739 <div class="paragraph"><p>If you have a setup where your mouse usually is in your way (like a touchpad\r
740 on your laptop which you do not want to disable completely), you might want\r
741 to disable <em>focus follows mouse</em> and control focus only by using your keyboard.\r
742 The mouse will still be useful inside the currently active window (for example\r
743 to click on links in your browser window).</p></div>\r
744 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
745 <div class="listingblock">\r
746 <div class="content">\r
747 <pre><tt>focus_follows_mouse &lt;yes|no&gt;</tt></pre>\r
748 </div></div>\r
749 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
750 <div class="listingblock">\r
751 <div class="content">\r
752 <pre><tt>focus_follows_mouse no</tt></pre>\r
753 </div></div>\r
754 </div>\r
755 <div class="sect2">\r
756 <h3 id="_popups_during_fullscreen_mode">4.16. Popups during fullscreen mode</h3>\r
757 <div class="paragraph"><p>When you are in fullscreen mode, some applications still open popup windows\r
758 (take Xpdf for example). This is because these applications may not be aware\r
759 that they are in fullscreen mode (they do not check the corresponding hint).\r
760 There are two things which are possible to do in this situation:</p></div>\r
761 <div class="olist arabic"><ol class="arabic">\r
762 <li>\r
763 <p>\r
764 Just ignore the popup (don’t map it). This won’t interrupt you while you are\r
765    in fullscreen. However, some apps might react badly to this (deadlock until\r
766    you go out of fullscreen).\r
767 </p>\r
768 </li>\r
769 <li>\r
770 <p>\r
771 Leave fullscreen mode. This is the default.\r
772 </p>\r
773 </li>\r
774 </ol></div>\r
775 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
776 <div class="listingblock">\r
777 <div class="content">\r
778 <pre><tt>popup_during_fullscreen &lt;ignore|leave_fullscreen&gt;</tt></pre>\r
779 </div></div>\r
780 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
781 <div class="listingblock">\r
782 <div class="content">\r
783 <pre><tt>popup_during_fullscreen ignore</tt></pre>\r
784 </div></div>\r
785 </div>\r
786 <div class="sect2">\r
787 <h3 id="_focus_wrapping">4.17. Focus wrapping</h3>\r
788 <div class="paragraph"><p>When being in a tabbed or stacked container, the first container will be\r
789 focused when you use <tt>focus down</tt> on the last container&#8201;&#8212;&#8201;the focus wraps. If\r
790 however there is another stacked/tabbed container in that direction, focus will\r
791 be set on that container. This is the default behaviour so you can navigate to\r
792 all your windows without having to use <tt>focus parent</tt>.</p></div>\r
793 <div class="paragraph"><p>If you want the focus to <strong>always</strong> wrap and you are aware of using <tt>focus\r
794 parent</tt> to switch to different containers, you can use the\r
795 <tt>force_focus_wrapping</tt> configuration directive. After enabling it, the focus\r
796 will always wrap.</p></div>\r
797 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
798 <div class="listingblock">\r
799 <div class="content">\r
800 <pre><tt>force_focus_wrapping &lt;yes|no&gt;</tt></pre>\r
801 </div></div>\r
802 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
803 <div class="listingblock">\r
804 <div class="content">\r
805 <pre><tt>force_focus_wrapping yes</tt></pre>\r
806 </div></div>\r
807 </div>\r
808 <div class="sect2">\r
809 <h3 id="_forcing_xinerama">4.18. Forcing Xinerama</h3>\r
810 <div class="paragraph"><p>As explained in-depth in <a href="http://i3wm.org/docs/multi-monitor.html">http://i3wm.org/docs/multi-monitor.html</a>, some X11\r
811 video drivers (especially the nVidia binary driver) only provide support for\r
812 Xinerama instead of RandR. In such a situation, i3 must be told to use the\r
813 inferior Xinerama API explicitly and therefore don’t provide support for\r
814 reconfiguring your screens on the fly (they are read only once on startup and\r
815 that’s it).</p></div>\r
816 <div class="paragraph"><p>For people who do cannot modify their <tt>~/.xsession</tt> to add the\r
817 <tt>--force-xinerama</tt> commandline parameter, a configuration option is provided:</p></div>\r
818 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
819 <div class="listingblock">\r
820 <div class="content">\r
821 <pre><tt>force_xinerama &lt;yes|no&gt;</tt></pre>\r
822 </div></div>\r
823 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
824 <div class="listingblock">\r
825 <div class="content">\r
826 <pre><tt>force_xinerama yes</tt></pre>\r
827 </div></div>\r
828 <div class="paragraph"><p>Also note that your output names are not descriptive (like <tt>HDMI1</tt>) when using\r
829 Xinerama, instead they are counted up, starting at 0: <tt>xinerama-0</tt>, <tt>xinerama-1</tt>, …</p></div>\r
830 </div>\r
831 <div class="sect2">\r
832 <h3 id="_automatic_back_and_forth_when_switching_to_the_current_workspace">4.19. Automatic back-and-forth when switching to the current workspace</h3>\r
833 <div class="paragraph"><p>This configuration directive enables automatic <tt>workspace back_and_forth</tt> (see\r
834 <a href="#back_and_forth">[back_and_forth]</a>) when switching to the workspace that is currently focused.</p></div>\r
835 <div class="paragraph"><p>For instance: Assume you are on workspace "1: www" and switch to "2: IM" using\r
836 mod+2 because somebody sent you a message. You don’t need to remember where you\r
837 came from now, you can just press mod+2 again to switch back to "1: www".</p></div>\r
838 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
839 <div class="listingblock">\r
840 <div class="content">\r
841 <pre><tt>workspace_auto_back_and_forth &lt;yes|no&gt;</tt></pre>\r
842 </div></div>\r
843 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
844 <div class="listingblock">\r
845 <div class="content">\r
846 <pre><tt>workspace_auto_back_and_forth yes</tt></pre>\r
847 </div></div>\r
848 </div>\r
849 </div>\r
850 </div>\r
851 <div class="sect1">\r
852 <h2 id="_configuring_i3bar">5. Configuring i3bar</h2>\r
853 <div class="sectionbody">\r
854 <div class="paragraph"><p>The bar at the bottom of your monitor is drawn by a separate process called\r
855 i3bar. Having this part of "the i3 user interface" in a separate process has\r
856 several advantages:</p></div>\r
857 <div class="olist arabic"><ol class="arabic">\r
858 <li>\r
859 <p>\r
860 It is a modular approach. If you don’t need a workspace bar at all, or if\r
861    you prefer a different one (dzen2, xmobar, maybe even gnome-panel?), you can\r
862    just remove the i3bar configuration and start your favorite bar instead.\r
863 </p>\r
864 </li>\r
865 <li>\r
866 <p>\r
867 It follows the UNIX philosophy of "Make each program do one thing well".\r
868    While i3 manages your windows well, i3bar is good at displaying a bar on\r
869    each monitor (unless you configure it otherwise).\r
870 </p>\r
871 </li>\r
872 <li>\r
873 <p>\r
874 It leads to two separate, clean codebases. If you want to understand i3, you\r
875    don’t need to bother with the details of i3bar and vice versa.\r
876 </p>\r
877 </li>\r
878 </ol></div>\r
879 <div class="paragraph"><p>That said, i3bar is configured in the same configuration file as i3. This is\r
880 because it is tightly coupled with i3 (in contrary to i3lock or i3status which\r
881 are useful for people using other window managers). Therefore, it makes no\r
882 sense to use a different configuration place when we already have a good\r
883 configuration infrastructure in place.</p></div>\r
884 <div class="paragraph"><p>Configuring your workspace bar starts with opening a <tt>bar</tt> block. You can have\r
885 multiple bar blocks to use different settings for different outputs (monitors):</p></div>\r
886 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
887 <div class="listingblock">\r
888 <div class="content">\r
889 <pre><tt>bar {\r
890     status_command i3status\r
891 }</tt></pre>\r
892 </div></div>\r
893 <div class="sect2">\r
894 <h3 id="_statusline_command">5.1. Statusline command</h3>\r
895 <div class="paragraph"><p>i3bar can run a program and display every line of its <tt>stdout</tt> output on the\r
896 right hand side of the bar. This is useful to display system information like\r
897 your current IP address, battery status or date/time.</p></div>\r
898 <div class="paragraph"><p>The specified command will be passed to <tt>sh -c</tt>, so you can use globbing and\r
899 have to have correct quoting etc.</p></div>\r
900 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
901 <div class="listingblock">\r
902 <div class="content">\r
903 <pre><tt>status_command command</tt></pre>\r
904 </div></div>\r
905 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
906 <div class="listingblock">\r
907 <div class="content">\r
908 <pre><tt>status_command i3status --config ~/.i3status.conf</tt></pre>\r
909 </div></div>\r
910 </div>\r
911 <div class="sect2">\r
912 <h3 id="_display_mode">5.2. Display mode</h3>\r
913 <div class="paragraph"><p>You can have i3bar either be visible permanently at one edge of the screen\r
914 (<tt>dock</tt> mode) or make it show up when you press your modifier key (<tt>hide</tt>\r
915 mode).</p></div>\r
916 <div class="paragraph"><p>The hide mode maximizes screen space that can be used for actual windows. Also,\r
917 i3bar sends the <tt>SIGSTOP</tt> and <tt>SIGCONT</tt> signals to the statusline process to\r
918 save battery power.</p></div>\r
919 <div class="paragraph"><p>The default is dock mode.</p></div>\r
920 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
921 <div class="listingblock">\r
922 <div class="content">\r
923 <pre><tt>mode &lt;dock|hide&gt;</tt></pre>\r
924 </div></div>\r
925 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
926 <div class="listingblock">\r
927 <div class="content">\r
928 <pre><tt>mode hide</tt></pre>\r
929 </div></div>\r
930 </div>\r
931 <div class="sect2">\r
932 <h3 id="_position">5.3. Position</h3>\r
933 <div class="paragraph"><p>This option determines in which edge of the screen i3bar should show up.</p></div>\r
934 <div class="paragraph"><p>The default is bottom.</p></div>\r
935 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
936 <div class="listingblock">\r
937 <div class="content">\r
938 <pre><tt>position &lt;top|bottom&gt;</tt></pre>\r
939 </div></div>\r
940 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
941 <div class="listingblock">\r
942 <div class="content">\r
943 <pre><tt>position top</tt></pre>\r
944 </div></div>\r
945 </div>\r
946 <div class="sect2">\r
947 <h3 id="_output_s">5.4. Output(s)</h3>\r
948 <div class="paragraph"><p>You can restrict i3bar to one or more outputs (monitors). The default is to\r
949 handle all outputs. Restricting the outputs is useful for using different\r
950 options for different outputs by using multiple <em>bar</em> blocks.</p></div>\r
951 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
952 <div class="listingblock">\r
953 <div class="content">\r
954 <pre><tt>output &lt;output&gt;</tt></pre>\r
955 </div></div>\r
956 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
957 <div class="listingblock">\r
958 <div class="content">\r
959 <pre><tt># big monitor: everything\r
960 bar {\r
961         output HDMI2\r
962         status_command i3status\r
963 }\r
964 \r
965 # laptop monitor: bright colors and i3status with less modules.\r
966 bar {\r
967         output LVDS1\r
968         status_command i3status --config ~/.i3status-small.conf\r
969         colors {\r
970                 background #000000\r
971                 statusline #ffffff\r
972         }\r
973 }</tt></pre>\r
974 </div></div>\r
975 </div>\r
976 <div class="sect2">\r
977 <h3 id="_tray_output">5.5. Tray output</h3>\r
978 <div class="paragraph"><p>i3bar by default provides a system tray area where programs such as\r
979 NetworkManager, VLC, Pidgin, etc. can place little icons.</p></div>\r
980 <div class="paragraph"><p>You can configure on which output (monitor) the icons should be displayed or\r
981 you can turn off the functionality entirely.</p></div>\r
982 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
983 <div class="listingblock">\r
984 <div class="content">\r
985 <pre><tt>tray_output &lt;none|output&gt;</tt></pre>\r
986 </div></div>\r
987 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
988 <div class="listingblock">\r
989 <div class="content">\r
990 <pre><tt># disable system tray\r
991 tray_output none\r
992 \r
993 # show tray icons on the big monitor\r
994 tray_output HDMI2</tt></pre>\r
995 </div></div>\r
996 </div>\r
997 <div class="sect2">\r
998 <h3 id="_font">5.6. Font</h3>\r
999 <div class="paragraph"><p>Specifies the font (again, X core font, not Xft, just like in i3) to be used in\r
1000 the bar.</p></div>\r
1001 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1002 <div class="listingblock">\r
1003 <div class="content">\r
1004 <pre><tt>font &lt;font&gt;</tt></pre>\r
1005 </div></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>font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1</tt></pre>\r
1010 </div></div>\r
1011 </div>\r
1012 <div class="sect2">\r
1013 <h3 id="_workspace_buttons">5.7. Workspace buttons</h3>\r
1014 <div class="paragraph"><p>Specifies whether workspace buttons should be shown or not. This is useful if\r
1015 you want to display a statusline-only bar containing additional information.</p></div>\r
1016 <div class="paragraph"><p>The default is to show workspace buttons.</p></div>\r
1017 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1018 <div class="listingblock">\r
1019 <div class="content">\r
1020 <pre><tt>workspace_buttons &lt;yes|no&gt;</tt></pre>\r
1021 </div></div>\r
1022 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1023 <div class="listingblock">\r
1024 <div class="content">\r
1025 <pre><tt>workspace_buttons no</tt></pre>\r
1026 </div></div>\r
1027 </div>\r
1028 <div class="sect2">\r
1029 <h3 id="_colors">5.8. Colors</h3>\r
1030 <div class="paragraph"><p>As with i3, colors are in HTML hex format (#rrggbb). The following colors can\r
1031 be configured at the moment:</p></div>\r
1032 <div class="dlist"><dl>\r
1033 <dt class="hdlist1">\r
1034 background\r
1035 </dt>\r
1036 <dd>\r
1037 <p>\r
1038         Background color of the bar.\r
1039 </p>\r
1040 </dd>\r
1041 <dt class="hdlist1">\r
1042 statusline\r
1043 </dt>\r
1044 <dd>\r
1045 <p>\r
1046         Text color to be used for the statusline.\r
1047 </p>\r
1048 </dd>\r
1049 <dt class="hdlist1">\r
1050 focused_workspace\r
1051 </dt>\r
1052 <dd>\r
1053 <p>\r
1054         Text color/background color for a workspace button when the workspace\r
1055         has focus.\r
1056 </p>\r
1057 </dd>\r
1058 <dt class="hdlist1">\r
1059 active_workspace\r
1060 </dt>\r
1061 <dd>\r
1062 <p>\r
1063         Text color/background color for a workspace button when the workspace\r
1064         is active (visible) on some output, but the focus is on another one.\r
1065         You can only tell this apart from the focused workspace when you are\r
1066         using multiple monitors.\r
1067 </p>\r
1068 </dd>\r
1069 <dt class="hdlist1">\r
1070 inactive_workspace\r
1071 </dt>\r
1072 <dd>\r
1073 <p>\r
1074         Text color/background color for a workspace button when the workspace\r
1075         does not have focus and is not active (visible) on any output. This\r
1076         will be the case for most workspaces.\r
1077 </p>\r
1078 </dd>\r
1079 <dt class="hdlist1">\r
1080 urgent_workspace\r
1081 </dt>\r
1082 <dd>\r
1083 <p>\r
1084         Text color/background color for workspaces which contain at least one\r
1085         window with the urgency hint set.\r
1086 </p>\r
1087 </dd>\r
1088 </dl></div>\r
1089 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1090 <div class="listingblock">\r
1091 <div class="content">\r
1092 <pre><tt>colors {\r
1093     background &lt;color&gt;\r
1094     statusline &lt;color&gt;\r
1095 \r
1096     colorclass &lt;foreground&gt; &lt;background&gt;\r
1097 }</tt></pre>\r
1098 </div></div>\r
1099 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1100 <div class="listingblock">\r
1101 <div class="content">\r
1102 <pre><tt>colors {\r
1103     background #000000\r
1104     statusline #ffffff\r
1105 \r
1106     focused_workspace  #ffffff #285577\r
1107     active_workspace   #ffffff #333333\r
1108     inactive_workspace #888888 #222222\r
1109     urgent_workspace   #ffffff #900000\r
1110 }</tt></pre>\r
1111 </div></div>\r
1112 </div>\r
1113 </div>\r
1114 </div>\r
1115 <div class="sect1">\r
1116 <h2 id="_list_of_commands">6. List of commands</h2>\r
1117 <div class="sectionbody">\r
1118 <div class="paragraph"><p>Commands are what you bind to specific keypresses. You can also issue commands\r
1119 at runtime without pressing a key by using the IPC interface. An easy way to\r
1120 do this is to use the <tt>i3-msg</tt> utility:</p></div>\r
1121 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1122 <div class="listingblock">\r
1123 <div class="content">\r
1124 <pre><tt># execute this on your shell to make the current container borderless\r
1125 i3-msg border none</tt></pre>\r
1126 </div></div>\r
1127 <div class="paragraph"><p>Commands can be chained by using <tt>;</tt> (a semicolon). So, to move a window to a\r
1128 specific workspace and immediately switch to that workspace, you can configure\r
1129 the following keybinding:</p></div>\r
1130 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1131 <div class="listingblock">\r
1132 <div class="content">\r
1133 <pre><tt>bindsym mod+x move workspace 3; workspace 3</tt></pre>\r
1134 </div></div>\r
1135 <div class="paragraph" id="command_criteria"><p>Furthermore, you can change the scope of a command, that is, which containers\r
1136 should be affected by that command, by using various criteria. These are\r
1137 prefixed in square brackets to every command. If you want to kill all windows\r
1138 which have the class Firefox, use:</p></div>\r
1139 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1140 <div class="listingblock">\r
1141 <div class="content">\r
1142 <pre><tt>bindsym mod+x [class="Firefox"] kill\r
1143 \r
1144 # same thing, but case-insensitive\r
1145 bindsym mod+x [class="(?i)firefox"] kill</tt></pre>\r
1146 </div></div>\r
1147 <div class="paragraph"><p>The criteria which are currently implemented are:</p></div>\r
1148 <div class="dlist"><dl>\r
1149 <dt class="hdlist1">\r
1150 class\r
1151 </dt>\r
1152 <dd>\r
1153 <p>\r
1154         Compares the window class (the second part of WM_CLASS)\r
1155 </p>\r
1156 </dd>\r
1157 <dt class="hdlist1">\r
1158 instance\r
1159 </dt>\r
1160 <dd>\r
1161 <p>\r
1162         Compares the window instance (the first part of WM_CLASS)\r
1163 </p>\r
1164 </dd>\r
1165 <dt class="hdlist1">\r
1166 window_role\r
1167 </dt>\r
1168 <dd>\r
1169 <p>\r
1170         Compares the window role (WM_WINDOW_ROLE).\r
1171 </p>\r
1172 </dd>\r
1173 <dt class="hdlist1">\r
1174 id\r
1175 </dt>\r
1176 <dd>\r
1177 <p>\r
1178         Compares the X11 window ID, which you can get via <tt>xwininfo</tt> for example.\r
1179 </p>\r
1180 </dd>\r
1181 <dt class="hdlist1">\r
1182 title\r
1183 </dt>\r
1184 <dd>\r
1185 <p>\r
1186         Compares the X11 window title (_NET_WM_NAME or WM_NAME as fallback).\r
1187 </p>\r
1188 </dd>\r
1189 <dt class="hdlist1">\r
1190 con_mark\r
1191 </dt>\r
1192 <dd>\r
1193 <p>\r
1194         Compares the mark set for this container, see <a href="#vim_like_marks">[vim_like_marks]</a>.\r
1195 </p>\r
1196 </dd>\r
1197 <dt class="hdlist1">\r
1198 con_id\r
1199 </dt>\r
1200 <dd>\r
1201 <p>\r
1202         Compares the i3-internal container ID, which you can get via the IPC\r
1203         interface. Handy for scripting.\r
1204 </p>\r
1205 </dd>\r
1206 </dl></div>\r
1207 <div class="paragraph"><p>The criteria <tt>class</tt>, <tt>instance</tt>, <tt>role</tt>, <tt>title</tt> and <tt>mark</tt> are actually\r
1208 regular expressions (PCRE). See <tt>pcresyntax(3)</tt> or <tt>perldoc perlre</tt> for\r
1209 information on how to use them.</p></div>\r
1210 <div class="sect2">\r
1211 <h3 id="exec">6.1. Executing applications (exec)</h3>\r
1212 <div class="paragraph"><p>What good is a window manager if you can’t actually start any applications?\r
1213 The exec command starts an application by passing the command you specify to a\r
1214 shell. This implies that you can use globbing (wildcards) and programs will be\r
1215 searched in your $PATH.</p></div>\r
1216 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1217 <div class="listingblock">\r
1218 <div class="content">\r
1219 <pre><tt>exec [--no-startup-id] command</tt></pre>\r
1220 </div></div>\r
1221 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1222 <div class="listingblock">\r
1223 <div class="content">\r
1224 <pre><tt># Start the GIMP\r
1225 bindsym mod+g exec gimp\r
1226 \r
1227 # Start the terminal emulator urxvt which is not yet startup-notification-aware\r
1228 bindsym mod+enter exec --no-startup-id urxvt</tt></pre>\r
1229 </div></div>\r
1230 <div class="paragraph"><p>The <tt>--no-startup-id</tt> parameter disables startup-notification support for this\r
1231 particular exec command. With startup-notification, i3 can make sure that a\r
1232 window appears on the workspace on which you used the exec command. Also, it\r
1233 will change the X11 cursor to <tt>watch</tt> (a clock) while the application is\r
1234 launching. So, if an application is not startup-notification aware (most GTK\r
1235 and Qt using applications seem to be, though), you will end up with a watch\r
1236 cursor for 60 seconds.</p></div>\r
1237 </div>\r
1238 <div class="sect2">\r
1239 <h3 id="_splitting_containers">6.2. Splitting containers</h3>\r
1240 <div class="paragraph"><p>The split command makes the current window a split container. Split containers\r
1241 can contain multiple windows. Every split container has an orientation, it is\r
1242 either split horizontally (a new window gets placed to the right of the current\r
1243 one) or vertically (a new window gets placed below the current one).</p></div>\r
1244 <div class="paragraph"><p>If you apply this command to a split container with the same orientation,\r
1245 nothing will happen. If you use a different orientation, the split container’s\r
1246 orientation will be changed (if it does not have more than one window).</p></div>\r
1247 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1248 <div class="listingblock">\r
1249 <div class="content">\r
1250 <pre><tt>split &lt;vertical|horizontal&gt;</tt></pre>\r
1251 </div></div>\r
1252 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1253 <div class="listingblock">\r
1254 <div class="content">\r
1255 <pre><tt>bindsym mod+v split vertical\r
1256 bindsym mod+h split horizontal</tt></pre>\r
1257 </div></div>\r
1258 </div>\r
1259 <div class="sect2">\r
1260 <h3 id="_manipulating_layout">6.3. Manipulating layout</h3>\r
1261 <div class="paragraph"><p>Use <tt>layout default</tt>, <tt>layout stacking</tt> or <tt>layout tabbed</tt> to change the\r
1262 current container layout to default, stacking or tabbed layout, respectively.</p></div>\r
1263 <div class="paragraph"><p>To make the current window (!) fullscreen, use <tt>fullscreen</tt>, to make\r
1264 it floating (or tiling again) use <tt>floating enable</tt> respectively <tt>floating disable</tt>\r
1265 (or <tt>floating toggle</tt>):</p></div>\r
1266 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
1267 <div class="listingblock">\r
1268 <div class="content">\r
1269 <pre><tt>bindsym mod+s layout stacking\r
1270 bindsym mod+l layout default\r
1271 bindsym mod+w layout tabbed\r
1272 \r
1273 # Toggle fullscreen\r
1274 bindsym mod+f fullscreen\r
1275 \r
1276 # Toggle floating/tiling\r
1277 bindsym mod+t floating toggle</tt></pre>\r
1278 </div></div>\r
1279 </div>\r
1280 <div class="sect2">\r
1281 <h3 id="_focusing_moving_containers">6.4. Focusing/Moving containers</h3>\r
1282 <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
1283 <div class="paragraph"><p>There are a few special parameters you can use for the focus command:</p></div>\r
1284 <div class="dlist"><dl>\r
1285 <dt class="hdlist1">\r
1286 parent\r
1287 </dt>\r
1288 <dd>\r
1289 <p>\r
1290         Sets focus to the <tt>Parent Container</tt> of the current <tt>Container</tt>.\r
1291 </p>\r
1292 </dd>\r
1293 <dt class="hdlist1">\r
1294 child\r
1295 </dt>\r
1296 <dd>\r
1297 <p>\r
1298         The opposite of <tt>focus parent</tt>, sets the focus to the last focused\r
1299         child container.\r
1300 </p>\r
1301 </dd>\r
1302 <dt class="hdlist1">\r
1303 floating\r
1304 </dt>\r
1305 <dd>\r
1306 <p>\r
1307         Sets focus to the last focused floating container.\r
1308 </p>\r
1309 </dd>\r
1310 <dt class="hdlist1">\r
1311 tiling\r
1312 </dt>\r
1313 <dd>\r
1314 <p>\r
1315         Sets focus to the last focused tiling container.\r
1316 </p>\r
1317 </dd>\r
1318 <dt class="hdlist1">\r
1319 mode_toggle\r
1320 </dt>\r
1321 <dd>\r
1322 <p>\r
1323         Toggles between floating/tiling containers.\r
1324 </p>\r
1325 </dd>\r
1326 </dl></div>\r
1327 <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
1328 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1329 <div class="listingblock">\r
1330 <div class="content">\r
1331 <pre><tt>focus &lt;left|right|down|up&gt;\r
1332 focus &lt;parent|child|floating|tiling|mode_toggle&gt;\r
1333 move &lt;left|right|down|up&gt; [&lt;px&gt; px]</tt></pre>\r
1334 </div></div>\r
1335 <div class="paragraph"><p>Note that the amount of pixels you can specify for the <tt>move</tt> command is only\r
1336 relevant for floating containers. The default amount is 10 pixels.</p></div>\r
1337 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
1338 <div class="listingblock">\r
1339 <div class="content">\r
1340 <pre><tt># Focus container on the left, bottom, top, right:\r
1341 bindsym mod+j focus left\r
1342 bindsym mod+k focus down\r
1343 bindsym mod+l focus up\r
1344 bindsym mod+semicolon focus right\r
1345 \r
1346 # Focus parent container\r
1347 bindsym mod+u focus parent\r
1348 \r
1349 # Focus last floating/tiling container\r
1350 bindsym mod+g focus mode_toggle\r
1351 \r
1352 # Move container to the left, bottom, top, right:\r
1353 bindsym mod+j move left\r
1354 bindsym mod+k move down\r
1355 bindsym mod+l move up\r
1356 bindsym mod+semicolon move right\r
1357 \r
1358 # Move container, but make floating containers\r
1359 # move more than the default\r
1360 bindsym mod+j move left 20 px</tt></pre>\r
1361 </div></div>\r
1362 </div>\r
1363 <div class="sect2">\r
1364 <h3 id="_changing_named_workspaces_moving_to_workspaces">6.5. Changing (named) workspaces/moving to workspaces</h3>\r
1365 <div class="paragraph"><p>To change to a specific workspace, use the <tt>workspace</tt> command, followed by the\r
1366 number or name of the workspace. To move containers to specific workspaces, use\r
1367 <tt>move workspace</tt>.</p></div>\r
1368 <div class="paragraph"><p>You can also switch to the next and previous workspace with the commands\r
1369 <tt>workspace next</tt> and <tt>workspace prev</tt>, which is handy, for example, if you have\r
1370 workspace 1, 3, 4 and 9 and you want to cycle through them with a single key\r
1371 combination. Similarily, you can use <tt>move workspace next</tt> and <tt>move workspace\r
1372 prev</tt> to move a container to the next/previous workspace.</p></div>\r
1373 <div class="paragraph" id="back_and_forth"><p>To switch back to the previously focused workspace, use <tt>workspace\r
1374 back_and_forth</tt>.</p></div>\r
1375 <div class="paragraph"><p>To move a container to another xrandr output such as <tt>LVDS1</tt> or <tt>VGA1</tt>, you can\r
1376 use the <tt>move output</tt> command followed by the name of the target output. You\r
1377 may also use <tt>left</tt>, <tt>right</tt>, <tt>up</tt>, <tt>down</tt> instead of the xrandr output name to\r
1378 move to the the next output in the specified direction.</p></div>\r
1379 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
1380 <div class="listingblock">\r
1381 <div class="content">\r
1382 <pre><tt>bindsym mod+1 workspace 1\r
1383 bindsym mod+2 workspace 2\r
1384 ...\r
1385 \r
1386 bindsym mod+Shift+1 move workspace 1\r
1387 bindsym mod+Shift+2 move workspace 2\r
1388 ...\r
1389 \r
1390 # switch between the current and the previously focused one\r
1391 bindsym mod+b workspace back_and_forth</tt></pre>\r
1392 </div></div>\r
1393 <div class="sect3">\r
1394 <h4 id="_named_workspaces">6.5.1. Named workspaces</h4>\r
1395 <div class="paragraph"><p>Workspaces are identified by their name. So, instead of using numbers in the\r
1396 workspace command, you can use an arbitrary name:</p></div>\r
1397 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1398 <div class="listingblock">\r
1399 <div class="content">\r
1400 <pre><tt>bindsym mod+1 workspace mail\r
1401 ...</tt></pre>\r
1402 </div></div>\r
1403 <div class="paragraph"><p>If you want the workspace to have a number <strong>and</strong> a name, just prefix the\r
1404 number, like this:</p></div>\r
1405 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1406 <div class="listingblock">\r
1407 <div class="content">\r
1408 <pre><tt>bindsym mod+1 workspace 1: mail\r
1409 bindsym mod+2 workspace 2: www\r
1410 ...</tt></pre>\r
1411 </div></div>\r
1412 <div class="paragraph"><p>Note that the workspace will really be named "1: mail". i3 treats workspace\r
1413 names beginning with a number in a slightly special way. Normally, named\r
1414 workspaces are ordered the way they appeared. When they start with a number, i3\r
1415 will order them numerically.</p></div>\r
1416 </div>\r
1417 </div>\r
1418 <div class="sect2">\r
1419 <h3 id="resizingconfig">6.6. Resizing containers/windows</h3>\r
1420 <div class="paragraph"><p>If you want to resize containers/windows using your keyboard, you can use the\r
1421 <tt>resize</tt> command:</p></div>\r
1422 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1423 <div class="listingblock">\r
1424 <div class="content">\r
1425 <pre><tt>resize &lt;grow|shrink&gt; &lt;direction&gt; [&lt;px&gt; px] [or &lt;ppt&gt; ppt]</tt></pre>\r
1426 </div></div>\r
1427 <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
1428 argument specifies by how many pixels a <strong>floating container</strong> should be grown or\r
1429 shrunk (the default is 10 pixels). The ppt argument means percentage points\r
1430 and specifies by how many percentage points a <strong>tiling container</strong> should be\r
1431 grown or shrunk (the default is 10 percentage points).</p></div>\r
1432 <div class="paragraph"><p>I recommend using the resize command inside a so called <tt>mode</tt>:</p></div>\r
1433 <div class="listingblock">\r
1434 <div class="title">Example: Configuration file, defining a mode for resizing</div>\r
1435 <div class="content">\r
1436 <pre><tt>mode "resize" {\r
1437         # These bindings trigger as soon as you enter the resize mode\r
1438 \r
1439         # They resize the border in the direction you pressed, e.g.\r
1440         # when pressing left, the window is resized so that it has\r
1441         # more space on its left\r
1442 \r
1443         bindsym j resize shrink left\r
1444         bindsym Shift+j resize grow left\r
1445 \r
1446         bindsym k resize grow down\r
1447         bindsym Shift+k resize shrink down\r
1448 \r
1449         bindsym l resize shrink up\r
1450         bindsym Shift+l resize grow up\r
1451 \r
1452         bindsym semicolon resize grow right\r
1453         bindsym Shift+semicolon resize shrink right\r
1454 \r
1455         # back to normal: Enter or Escape\r
1456         bindsym Return mode "default"\r
1457         bindsym Escape mode "default"\r
1458 }\r
1459 \r
1460 # Enter resize mode\r
1461 bindsym mod+r mode "resize"</tt></pre>\r
1462 </div></div>\r
1463 </div>\r
1464 <div class="sect2">\r
1465 <h3 id="_jumping_to_specific_windows">6.7. Jumping to specific windows</h3>\r
1466 <div class="paragraph"><p>Often when in a multi-monitor environment, you want to quickly jump to a\r
1467 specific window. For example, while working on workspace 3 you may want to\r
1468 jump to your mail client to email your boss that you’ve achieved some\r
1469 important goal. Instead of figuring out how to navigate to your mailclient,\r
1470 it would be more convenient to have a shortcut. You can use the <tt>focus</tt> command\r
1471 with criteria for that.</p></div>\r
1472 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1473 <div class="listingblock">\r
1474 <div class="content">\r
1475 <pre><tt>[class="class"] focus\r
1476 [title="title"] focus</tt></pre>\r
1477 </div></div>\r
1478 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
1479 <div class="listingblock">\r
1480 <div class="content">\r
1481 <pre><tt># Get me to the next open VIM instance\r
1482 bindsym mod+a [class="urxvt" title="VIM"] focus</tt></pre>\r
1483 </div></div>\r
1484 </div>\r
1485 <div class="sect2">\r
1486 <h3 id="_vim_like_marks_mark_goto">6.8. VIM-like marks (mark/goto)</h3>\r
1487 <div class="paragraph" id="vim_like_marks"><p>This feature is like the jump feature: It allows you to directly jump to a\r
1488 specific window (this means switching to the appropriate workspace and setting\r
1489 focus to the windows). However, you can directly mark a specific window with\r
1490 an arbitrary label and use it afterwards.  You do not need to ensure that your\r
1491 windows have unique classes or titles, and you do not need to change your\r
1492 configuration file.</p></div>\r
1493 <div class="paragraph"><p>As the command needs to include the label with which you want to mark the\r
1494 window, you cannot simply bind it to a key.  <tt>i3-input</tt> is a tool created\r
1495 for this purpose: It lets you input a command and sends the command to i3. It\r
1496 can also prefix this command and display a custom prompt for the input dialog.</p></div>\r
1497 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1498 <div class="listingblock">\r
1499 <div class="content">\r
1500 <pre><tt>mark identifier\r
1501 [con_mark="identifier"] focus</tt></pre>\r
1502 </div></div>\r
1503 <div class="paragraph"><p><strong>Example (in a terminal)</strong>:</p></div>\r
1504 <div class="listingblock">\r
1505 <div class="content">\r
1506 <pre><tt>$ i3-msg mark irssi\r
1507 $ i3-msg '[con_mark="irssi"] focus'</tt></pre>\r
1508 </div></div>\r
1509 </div>\r
1510 <div class="sect2">\r
1511 <h3 id="_changing_border_style">6.9. Changing border style</h3>\r
1512 <div class="paragraph"><p>To change the border of the current client, you can use <tt>border normal</tt> to use the normal\r
1513 border (including window title), <tt>border 1pixel</tt> to use a 1-pixel border (no window title)\r
1514 and <tt>border none</tt> to make the client borderless.</p></div>\r
1515 <div class="paragraph"><p>There is also <tt>border toggle</tt> which will toggle the different border styles.</p></div>\r
1516 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
1517 <div class="listingblock">\r
1518 <div class="content">\r
1519 <pre><tt>bindsym mod+t border normal\r
1520 bindsym mod+y border 1pixel\r
1521 bindsym mod+u border none</tt></pre>\r
1522 </div></div>\r
1523 </div>\r
1524 <div class="sect2">\r
1525 <h3 id="stack-limit">6.10. Reloading/Restarting/Exiting</h3>\r
1526 <div class="paragraph"><p>You can make i3 reload its configuration file with <tt>reload</tt>. You can also\r
1527 restart i3 inplace with the <tt>restart</tt> command to get it out of some weird state\r
1528 (if that should ever happen) or to perform an upgrade without having to restart\r
1529 your X session. To exit i3 properly, you can use the <tt>exit</tt> command,\r
1530 however you don’t need to (simply killing your X session is fine as well).</p></div>\r
1531 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
1532 <div class="listingblock">\r
1533 <div class="content">\r
1534 <pre><tt>bindsym mod+Shift+r restart\r
1535 bindsym mod+Shift+w reload\r
1536 bindsym mod+Shift+e exit</tt></pre>\r
1537 </div></div>\r
1538 </div>\r
1539 </div>\r
1540 </div>\r
1541 <div class="sect1">\r
1542 <h2 id="multi_monitor">7. Multiple monitors</h2>\r
1543 <div class="sectionbody">\r
1544 <div class="paragraph"><p>As you can see in the goal list on the website, i3 was specifically developed\r
1545 with support for multiple monitors in mind. This section will explain how to\r
1546 handle multiple monitors.</p></div>\r
1547 <div class="paragraph"><p>When you have only one monitor, things are simple. You usually start with\r
1548 workspace 1 on your monitor and open new ones as you need them.</p></div>\r
1549 <div class="paragraph"><p>When you have more than one monitor, each monitor will get an initial\r
1550 workspace.  The first monitor gets 1, the second gets 2 and a possible third\r
1551 would get 3. When you switch to a workspace on a different monitor, i3 will\r
1552 switch to that monitor and then switch to the workspace. This way, you don’t\r
1553 need shortcuts to switch to a specific monitor, and you don’t need to remember\r
1554 where you put which workspace. New workspaces will be opened on the currently\r
1555 active monitor.  It is not possible to have a monitor without a workspace.</p></div>\r
1556 <div class="paragraph"><p>The idea of making workspaces global is based on the observation that most\r
1557 users have a very limited set of workspaces on their additional monitors.\r
1558 They are often used for a specific task (browser, shell) or for monitoring\r
1559 several things (mail, IRC, syslog, …). Thus, using one workspace on one monitor\r
1560 and "the rest" on the other monitors often makes sense. However, as you can\r
1561 create an unlimited number of workspaces in i3 and tie them to specific\r
1562 screens, you can have the "traditional" approach of having X workspaces per\r
1563 screen by changing your configuration (using modes, for example).</p></div>\r
1564 <div class="sect2">\r
1565 <h3 id="_configuring_your_monitors">7.1. Configuring your monitors</h3>\r
1566 <div class="paragraph"><p>To help you get going if you have never used multiple monitors before, here is\r
1567 a short overview of the xrandr options which will probably be of interest to\r
1568 you. It is always useful to get an overview of the current screen configuration.\r
1569 Just run "xrandr" and you will get an output like the following:</p></div>\r
1570 <div class="listingblock">\r
1571 <div class="content">\r
1572 <pre><tt>$ xrandr\r
1573 Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192\r
1574 VGA1 disconnected (normal left inverted right x axis y axis)\r
1575 LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm\r
1576    1280x800       60.0*+   50.0\r
1577    1024x768       85.0     75.0     70.1     60.0\r
1578    832x624        74.6\r
1579    800x600        85.1     72.2     75.0     60.3     56.2\r
1580    640x480        85.0     72.8     75.0     59.9\r
1581    720x400        85.0\r
1582    640x400        85.1\r
1583    640x350        85.1</tt></pre>\r
1584 </div></div>\r
1585 <div class="paragraph"><p>Several things are important here: You can see that <tt>LVDS1</tt> is connected (of\r
1586 course, it is the internal flat panel) but <tt>VGA1</tt> is not. If you have a monitor\r
1587 connected to one of the ports but xrandr still says "disconnected", you should\r
1588 check your cable, monitor or graphics driver.</p></div>\r
1589 <div class="paragraph"><p>The maximum resolution you can see at the end of the first line is the maximum\r
1590 combined resolution of your monitors. By default, it is usually too low and has\r
1591 to be increased by editing <tt>/etc/X11/xorg.conf</tt>.</p></div>\r
1592 <div class="paragraph"><p>So, say you connected VGA1 and want to use it as an additional screen:</p></div>\r
1593 <div class="listingblock">\r
1594 <div class="content">\r
1595 <pre><tt>xrandr --output VGA1 --auto --left-of LVDS1</tt></pre>\r
1596 </div></div>\r
1597 <div class="paragraph"><p>This command makes xrandr try to find the native resolution of the device\r
1598 connected to <tt>VGA1</tt> and configures it to the left of your internal flat panel.\r
1599 When running "xrandr" again, the output looks like this:</p></div>\r
1600 <div class="listingblock">\r
1601 <div class="content">\r
1602 <pre><tt>$ xrandr\r
1603 Screen 0: minimum 320 x 200, current 2560 x 1024, maximum 8192 x 8192\r
1604 VGA1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm\r
1605    1280x1024      60.0*+   75.0\r
1606    1280x960       60.0\r
1607    1152x864       75.0\r
1608    1024x768       75.1     70.1     60.0\r
1609    832x624        74.6\r
1610    800x600        72.2     75.0     60.3     56.2\r
1611    640x480        72.8     75.0     66.7     60.0\r
1612    720x400        70.1\r
1613 LVDS1 connected 1280x800+1280+0 (normal left inverted right x axis y axis) 261mm x 163mm\r
1614    1280x800       60.0*+   50.0\r
1615    1024x768       85.0     75.0     70.1     60.0\r
1616    832x624        74.6\r
1617    800x600        85.1     72.2     75.0     60.3     56.2\r
1618    640x480        85.0     72.8     75.0     59.9\r
1619    720x400        85.0\r
1620    640x400        85.1\r
1621    640x350        85.1</tt></pre>\r
1622 </div></div>\r
1623 <div class="paragraph"><p>Please note that i3 uses exactly the same API as xrandr does, so it will see\r
1624 only what you can see in xrandr.</p></div>\r
1625 <div class="paragraph"><p>See also <a href="#presentations">[presentations]</a> for more examples of multi-monitor setups.</p></div>\r
1626 </div>\r
1627 <div class="sect2">\r
1628 <h3 id="_interesting_configuration_for_multi_monitor_environments">7.2. Interesting configuration for multi-monitor environments</h3>\r
1629 <div class="paragraph"><p>There are several things to configure in i3 which may be interesting if you\r
1630 have more than one monitor:</p></div>\r
1631 <div class="olist arabic"><ol class="arabic">\r
1632 <li>\r
1633 <p>\r
1634 You can specify which workspace should be put on which screen. This\r
1635    allows you to have a different set of workspaces when starting than just\r
1636    1 for the first monitor, 2 for the second and so on. See\r
1637    <a href="#workspace_screen">[workspace_screen]</a>.\r
1638 </p>\r
1639 </li>\r
1640 <li>\r
1641 <p>\r
1642 If you want some applications to generally open on the bigger screen\r
1643    (MPlayer, Firefox, …), you can assign them to a specific workspace, see\r
1644    <a href="#assign_workspace">[assign_workspace]</a>.\r
1645 </p>\r
1646 </li>\r
1647 <li>\r
1648 <p>\r
1649 If you have many workspaces on many monitors, it might get hard to keep\r
1650    track of which window you put where. Thus, you can use vim-like marks to\r
1651    quickly switch between windows. See <a href="#vim_like_marks">[vim_like_marks]</a>.\r
1652 </p>\r
1653 </li>\r
1654 </ol></div>\r
1655 </div>\r
1656 </div>\r
1657 </div>\r
1658 <div class="sect1">\r
1659 <h2 id="_i3_and_the_rest_of_your_software_world">8. i3 and the rest of your software world</h2>\r
1660 <div class="sectionbody">\r
1661 <div class="sect2">\r
1662 <h3 id="_displaying_a_status_line">8.1. Displaying a status line</h3>\r
1663 <div class="paragraph"><p>A very common thing amongst users of exotic window managers is a status line at\r
1664 some corner of the screen. It is an often superior replacement to the widget\r
1665 approach you have in the task bar of a traditional desktop environment.</p></div>\r
1666 <div class="paragraph"><p>If you don’t already have your favorite way of generating such a status line\r
1667 (self-written scripts, conky, …), then i3status is the recommended tool for\r
1668 this task. It was written in C with the goal of using as few syscalls as\r
1669 possible to reduce the time your CPU is woken up from sleep states. Because\r
1670 i3status only spits out text, you need to combine it with some other tool, like\r
1671 i3bar. Use a pipe to connect them: <tt>i3status | i3bar -d</tt>.</p></div>\r
1672 <div class="paragraph"><p>Regardless of which application you use to display the status line, you\r
1673 want to make sure that it registers as a dock window using EWMH hints. i3 will\r
1674 position the window either at the top or at the bottom of the screen, depending\r
1675 on which hint the application sets. With i3bar, you can use <tt>-d</tt> or <tt>-dbottom</tt>\r
1676 for positioning it at the bottom and <tt>-dtop</tt> to position it at the top of the\r
1677 screen.</p></div>\r
1678 </div>\r
1679 <div class="sect2">\r
1680 <h3 id="_giving_presentations_multi_monitor">8.2. Giving presentations (multi-monitor)</h3>\r
1681 <div class="paragraph"><p>When giving a presentation, you typically want the audience to see what you see\r
1682 on your screen and then go through a series of slides (if the presentation is\r
1683 simple). For more complex presentations, you might want to have some notes\r
1684 which only you can see on your screen, while the audience can only see the\r
1685 slides.</p></div>\r
1686 <div class="sect3">\r
1687 <h4 id="presentations">8.2.1. Case 1: everybody gets the same output</h4>\r
1688 <div class="paragraph"><p>This is the simple case. You connect your computer to the video projector,\r
1689 turn on both (computer and video projector) and configure your X server to\r
1690 clone the internal flat panel of your computer to the video output:</p></div>\r
1691 <div class="listingblock">\r
1692 <div class="content">\r
1693 <pre><tt>xrandr --output VGA1 --mode 1024x768 --same-as LVDS1</tt></pre>\r
1694 </div></div>\r
1695 <div class="paragraph"><p>i3 will then use the lowest common subset of screen resolutions, the rest of\r
1696 your screen will be left untouched (it will show the X background). So, in\r
1697 our example, this would be 1024x768 (my notebook has 1280x800).</p></div>\r
1698 </div>\r
1699 <div class="sect3">\r
1700 <h4 id="_case_2_you_can_see_more_than_your_audience">8.2.2. Case 2: you can see more than your audience</h4>\r
1701 <div class="paragraph"><p>This case is a bit harder. First of all, you should configure the VGA output\r
1702 somewhere near your internal flat panel, say right of it:</p></div>\r
1703 <div class="listingblock">\r
1704 <div class="content">\r
1705 <pre><tt>xrandr --output VGA1 --mode 1024x768 --right-of LVDS1</tt></pre>\r
1706 </div></div>\r
1707 <div class="paragraph"><p>Now, i3 will put a new workspace (depending on your settings) on the new screen\r
1708 and you are in multi-monitor mode (see <a href="#multi_monitor">[multi_monitor]</a>).</p></div>\r
1709 <div class="paragraph"><p>Because i3 is not a compositing window manager, there is no ability to\r
1710 display a window on two screens at the same time. Instead, your presentation\r
1711 software needs to do this job (that is, open a window on each screen).</p></div>\r
1712 </div>\r
1713 </div>\r
1714 </div>\r
1715 </div>\r
1716 </div>\r
1717 <div id="footnotes"><hr /></div>\r
1718 <div id="footer" lang="de">\r
1719 © 2009-2011 Michael Stapelberg, <a href="/impress.html">Impressum</a>\r
1720 </div>\r
1721 </body>\r
1722 </html>\r