]> git.sur5r.net Git - i3/i3.github.io/blob - docs/userguide.html
df5196c8702096b2a1bf7978fbac4f1101f19e75
[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 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
6 <meta name="generator" content="AsciiDoc 8.6.4" />\r
7 <title>i3: i3 User’s Guide</title>\r
8 <link rel="stylesheet" href="/css/style.css" type="text/css" />\r
9 <link rel="stylesheet" href="/css/xhtml11.css" type="text/css" />\r
10 <script type="text/javascript">\r
11 /*<![CDATA[*/\r
12 window.onload = function(){asciidoc.footnotes(); asciidoc.toc(2);}\r
13 /*]]>*/\r
14 </script>\r
15 <script type="text/javascript" src="/js/asciidoc-xhtml11.js"></script>\r
16 </head>\r
17 <body class="article">\r
18 \r
19         <div id="main">\r
20             <a href="/"><h1 id="title">i3 - improved tiling WM</h1></a>\r
21                         <ul id="nav">\r
22                                 <li><a style="border-bottom: 2px solid #fff" href="/docs">Docs</a></li>\r
23                                 <li><a href="/screenshots">Screens</a></li>\r
24                                 <li><a href="/contact">Contact</a></li>\r
25                                 <li><a href="http://bugs.i3wm.org/">Bugs</a></li>\r
26                         </ul>\r
27         <br style="clear: both">\r
28 <div id="content">\r
29 <div id="header">\r
30 <h1>i3 User’s Guide</h1>\r
31 <span id="author">Michael Stapelberg</span><br />\r
32 <span id="email"><tt>&lt;<a href="mailto:michael+i3@stapelberg.de">michael+i3@stapelberg.de</a>&gt;</tt></span><br />\r
33 <span id="revdate">March 2010</span>\r
34 <div id="toc">
35   <div id="toctitle">Table of Contents</div>
36   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
37 </div>\r
38 </div>\r
39 <div id="preamble">\r
40 <div class="sectionbody">\r
41 <div class="paragraph"><p>This document contains all the information you need to configure and use the i3\r
42 window manager. If it does not, please contact me on IRC, Jabber or E-Mail and\r
43 I’ll help you out.</p></div>\r
44 </div>\r
45 </div>\r
46 <div class="sect1">\r
47 <h2 id="_default_keybindings">1. Default keybindings</h2>\r
48 <div class="sectionbody">\r
49 <div class="paragraph"><p>For the "too long; didn’t read" people, here is an overview of the default\r
50 keybindings (click to see the full size image):</p></div>\r
51 <div class="paragraph"><p><strong>Keys to use with Mod1 (alt):</strong></p></div>\r
52 <div class="paragraph"><p><span class="image">\r
53 <a class="image" href="keyboard-layer1.png">\r
54 <img src="keyboard-layer1.png" alt="Keys to use with Mod1 (alt)" width="600" />\r
55 </a>\r
56 </span></p></div>\r
57 <div class="paragraph"><p><strong>Keys to use with Shift+Mod1:</strong></p></div>\r
58 <div class="paragraph"><p><span class="image">\r
59 <a class="image" href="keyboard-layer2.png">\r
60 <img src="keyboard-layer2.png" alt="Keys to use with Shift+Mod1" width="600" />\r
61 </a>\r
62 </span></p></div>\r
63 <div class="paragraph"><p>As i3 uses keycodes in the default configuration, it does not matter which\r
64 keyboard layout you actually use. The key positions are what matters (of course\r
65 you can also use keysymbols, see <a href="#keybindings">[keybindings]</a>).</p></div>\r
66 <div class="paragraph"><p>The red keys are the modifiers you need to press (by default), the blue keys\r
67 are your homerow.</p></div>\r
68 </div>\r
69 </div>\r
70 <div class="sect1">\r
71 <h2 id="_using_i3">2. Using i3</h2>\r
72 <div class="sectionbody">\r
73 <div class="sect2">\r
74 <h3 id="_opening_terminals_and_moving_around">2.1. Opening terminals and moving around</h3>\r
75 <div class="paragraph"><p>One very basic operation is opening a new terminal. By default, the keybinding\r
76 for this is Mod1+Enter, that is Alt+Enter in the default configuration. By\r
77 pressing Mod1+Enter, a new terminal will be opened.  It will fill the whole\r
78 space available on your screen.</p></div>\r
79 <div class="paragraph"><p><span class="image">\r
80 <img src="single_terminal.png" alt="Single terminal" />\r
81 </span></p></div>\r
82 <div class="paragraph"><p>It is important to keep in mind that i3 uses a table to manage your windows. At\r
83 the moment, you have exactly one column and one row which leaves you with one\r
84 cell. In this cell there is a container, which is where your new terminal is\r
85 opened.</p></div>\r
86 <div class="paragraph"><p>If you now open another terminal, you still have only one cell. However, the\r
87 container in that cell holds both of your terminals. So, a container is just a\r
88 group of clients with a specific layout. Containers can be resized by adjusting\r
89 the size of the cell that holds them.</p></div>\r
90 <div class="paragraph"><p><span class="image">\r
91 <img src="two_terminals.png" alt="Two terminals" />\r
92 </span></p></div>\r
93 <div class="paragraph"><p>To move the focus between the two terminals, you use the direction keys which\r
94 you may know from the editor <tt>vi</tt>. However, in i3, your homerow is used for\r
95 these keys (in <tt>vi</tt>, the keys are shifted to the left by one for compatibility\r
96 with most keyboard layouts). Therefore, <tt>Mod1+J</tt> is left, <tt>Mod1+K</tt> is down,\r
97 <tt>Mod1+L</tt> is up and <tt>Mod1+;</tt> is right. So, to switch between the terminals,\r
98 use <tt>Mod1+K</tt> or <tt>Mod1+L</tt>.</p></div>\r
99 <div class="paragraph"><p>To create a new row/column (and a new cell), you can simply move a terminal (or\r
100 any other window) in the direction you want to expand your table. So, let’s\r
101 expand the table to the right by pressing <tt>Mod1+Shift+;</tt>.</p></div>\r
102 <div class="paragraph"><p><span class="image">\r
103 <img src="two_columns.png" alt="Two columns" />\r
104 </span></p></div>\r
105 </div>\r
106 <div class="sect2">\r
107 <h3 id="_changing_container_modes">2.2. Changing container modes</h3>\r
108 <div class="paragraph"><p>A container can have the following modes:</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>Mod1+e</tt> for default, <tt>Mod1+h</tt> for stacking and\r
139 <tt>Mod1+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 fullscreen or to go out of fullscreen mode again, press\r
147 <tt>Mod1+f</tt>.</p></div>\r
148 <div class="paragraph"><p>There is also a global fullscreen mode in i3 in which the client will use all\r
149 available outputs. To use it, or to get out of it again, press <tt>Mod1+Shift+f</tt>.</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>Mod1+v</tt> by default. Just type the name\r
155 (or a part of it) of the application which you want to open. The application\r
156 typed 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 "Configuring i3" 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>Mod1+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>Mod1+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>Mod1+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_columns_rows">2.8. Resizing columns/rows</h3>\r
194 <div class="paragraph"><p>To resize columns or rows, just grab the border between the two columns/rows\r
195 and move it to the wanted size. Please keep in mind that each cell of the table\r
196 holds a <tt>container</tt> and thus you cannot horizontally resize single windows.  If\r
197 you need applications with different horizontal sizes, place them in seperate\r
198 cells one above the other.</p></div>\r
199 <div class="paragraph"><p>See <a href="#resizingconfig">[resizingconfig]</a> for how to configure i3 to be able to resize\r
200 columns/rows with your keyboard.</p></div>\r
201 </div>\r
202 <div class="sect2">\r
203 <h3 id="_restarting_i3_inplace">2.9. Restarting i3 inplace</h3>\r
204 <div class="paragraph"><p>To restart i3 inplace (and thus get into a clean state if there is a bug, or\r
205 to upgrade to a newer version of i3) you can use <tt>Mod1+Shift+r</tt>. Be aware,\r
206 though, that this kills your current layout and all the windows you have opened\r
207 will be put in a default container in only one cell. Saving layouts will be\r
208 implemented in a later version.</p></div>\r
209 </div>\r
210 <div class="sect2">\r
211 <h3 id="_exiting_i3">2.10. Exiting i3</h3>\r
212 <div class="paragraph"><p>To cleanly exit i3 without killing your X server, you can use <tt>Mod1+Shift+e</tt>.</p></div>\r
213 </div>\r
214 <div class="sect2">\r
215 <h3 id="_snapping">2.11. Snapping</h3>\r
216 <div class="paragraph"><p>Snapping is a mechanism to increase/decrease the colspan/rowspan of a container.\r
217 Colspan/rowspan is the number of columns/rows a specific cell of the table\r
218 consumes. This is easier explained by giving an example, so take the following\r
219 layout:</p></div>\r
220 <div class="paragraph"><p><span class="image">\r
221 <img src="snapping.png" alt="Snapping example" />\r
222 </span></p></div>\r
223 <div class="paragraph"><p>To use the full size of your screen, you can now snap container 3 downwards\r
224 by pressing <tt>Mod1+Control+k</tt> (or snap container 2 rightwards).</p></div>\r
225 </div>\r
226 <div class="sect2">\r
227 <h3 id="_floating">2.12. Floating</h3>\r
228 <div class="paragraph"><p>Floating mode is the opposite of tiling mode. The position and size of a window\r
229 are not managed by i3, but by you. Using this mode violates the tiling\r
230 paradigm but can be useful for some corner cases like "Save as" dialog\r
231 windows, or toolbar windows (GIMP or similar).</p></div>\r
232 <div class="paragraph"><p>You can enable floating mode for a window by pressing <tt>Mod1+Shift+Space</tt>. By\r
233 dragging the window’s titlebar with your mouse you can move the window\r
234 around. By grabbing the borders and moving them you can resize the window. You\r
235 can also do that by using the <a href="#floating_modifier">[floating_modifier]</a>.</p></div>\r
236 <div class="paragraph"><p>For resizing floating windows with your keyboard, see <a href="#resizingconfig">[resizingconfig]</a>.</p></div>\r
237 <div class="paragraph"><p>Floating windows are always on top of tiling windows.</p></div>\r
238 </div>\r
239 </div>\r
240 </div>\r
241 <div class="sect1">\r
242 <h2 id="_configuring_i3">3. Configuring i3</h2>\r
243 <div class="sectionbody">\r
244 <div class="paragraph"><p>This is where the real fun begins ;-). Most things are very dependant on your\r
245 ideal working environment so we can’t make reasonable defaults for them.</p></div>\r
246 <div class="paragraph"><p>While not using a programming language for the configuration, i3 stays\r
247 quite flexible in regards to the things you usually want your window manager\r
248 to do.</p></div>\r
249 <div class="paragraph"><p>For example, you can configure bindings to jump to specific windows,\r
250 you can set specific applications to start on specific workspaces, you can\r
251 automatically start applications, you can change the colors of i3, and you\r
252 can bind your keys to do useful things.</p></div>\r
253 <div class="paragraph"><p>To change the configuration of i3, copy <tt>/etc/i3/config</tt> to <tt>~/.i3/config</tt>\r
254 (or <tt>~/.config/i3/config</tt> if you like the XDG directory scheme) and edit it\r
255 with a text editor.</p></div>\r
256 <div class="sect2">\r
257 <h3 id="_comments">3.1. Comments</h3>\r
258 <div class="paragraph"><p>It is possible and recommended to use comments in your configuration file to\r
259 properly document your setup for later reference. Comments are started with\r
260 a # and can only be used at the beginning of a line:</p></div>\r
261 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
262 <div class="listingblock">\r
263 <div class="content">\r
264 <pre><tt># This is a comment</tt></pre>\r
265 </div></div>\r
266 </div>\r
267 <div class="sect2">\r
268 <h3 id="_fonts">3.2. Fonts</h3>\r
269 <div class="paragraph"><p>i3 uses X core fonts (not Xft) for rendering window titles and the internal\r
270 workspace bar. You can use <tt>xfontsel(1)</tt> to generate such a font description.\r
271 To see special characters (Unicode), you need to use a font which supports\r
272 the ISO-10646 encoding.</p></div>\r
273 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
274 <div class="listingblock">\r
275 <div class="content">\r
276 <pre><tt>font &lt;X core font description&gt;</tt></pre>\r
277 </div></div>\r
278 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
279 <div class="listingblock">\r
280 <div class="content">\r
281 <pre><tt>font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1</tt></pre>\r
282 </div></div>\r
283 </div>\r
284 <div class="sect2">\r
285 <h3 id="keybindings">3.3. Keyboard bindings</h3>\r
286 <div class="paragraph"><p>A keyboard binding makes i3 execute a command (see below) upon pressing a\r
287 specific key. i3 allows you to bind either on keycodes or on keysyms (you can\r
288 also mix your bindings, though i3 will not protect you from overlapping ones).</p></div>\r
289 <div class="ulist"><ul>\r
290 <li>\r
291 <p>\r
292 A keysym (key symbol) is a description for a specific symbol, like "a"\r
293   or "b", but also more strange ones like "underscore" instead of "_". These\r
294   are the ones you use in Xmodmap to remap your keys. To get the current\r
295   mapping of your keys, use <tt>xmodmap -pke</tt>.\r
296 </p>\r
297 </li>\r
298 <li>\r
299 <p>\r
300 Keycodes do not need to have a symbol assigned (handy for some hotkeys\r
301   on some notebooks) and they will not change their meaning as you switch to a\r
302   different keyboard layout (when using <tt>xmodmap</tt>).\r
303 </p>\r
304 </li>\r
305 </ul></div>\r
306 <div class="paragraph"><p>My recommendation is: If you often switch keyboard layouts but you want to keep\r
307 your bindings in the same physical location on the keyboard, use keycodes.\r
308 If you don’t switch layouts, and want a clean and simple config file, use\r
309 keysyms.</p></div>\r
310 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
311 <div class="listingblock">\r
312 <div class="content">\r
313 <pre><tt>bindsym [Modifiers+]keysym command\r
314 bind [Modifiers+]keycode command</tt></pre>\r
315 </div></div>\r
316 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
317 <div class="listingblock">\r
318 <div class="content">\r
319 <pre><tt># Fullscreen\r
320 bindsym Mod1+f f\r
321 \r
322 # Restart\r
323 bindsym Mod1+Shift+r restart\r
324 \r
325 # Notebook-specific hotkeys\r
326 bind 214 exec /home/michael/toggle_beamer.sh</tt></pre>\r
327 </div></div>\r
328 <div class="paragraph"><p>Available Modifiers:</p></div>\r
329 <div class="dlist"><dl>\r
330 <dt class="hdlist1">\r
331 Mod1-Mod5, Shift, Control\r
332 </dt>\r
333 <dd>\r
334 <p>\r
335 Standard modifiers, see <tt>xmodmap(1)</tt>\r
336 </p>\r
337 </dd>\r
338 <dt class="hdlist1">\r
339 Mode_switch\r
340 </dt>\r
341 <dd>\r
342 <p>\r
343 Unlike other window managers, i3 can use Mode_switch as a modifier. This allows\r
344 you to remap capslock (for example) to Mode_switch and use it for both: typing\r
345 umlauts or special characters <em>and</em> having some comfortably reachable key\r
346 bindings. For example, when typing, capslock+1 or capslock+2 for switching\r
347 workspaces is totally convenient. Try it :-).\r
348 </p>\r
349 </dd>\r
350 </dl></div>\r
351 </div>\r
352 <div class="sect2">\r
353 <h3 id="floating_modifier">3.4. The floating modifier</h3>\r
354 <div class="paragraph"><p>To move floating windows with your mouse, you can either grab their titlebar\r
355 or configure the so called floating modifier which you can then press and\r
356 click anywhere in the window itself to move it. The most common setup is to\r
357 use the same key you use for managing windows (Mod1 for example). Then\r
358 you can press Mod1, click into a window using your left mouse button, and drag\r
359 it to the position you want.</p></div>\r
360 <div class="paragraph"><p>When holding the floating modifier, you can resize a floating window by\r
361 pressing the right mouse button on it and moving around while holding it. If\r
362 you hold the shift button as well, the resize will be proportional.</p></div>\r
363 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
364 <div class="listingblock">\r
365 <div class="content">\r
366 <pre><tt>floating_modifier &lt;Modifiers&gt;</tt></pre>\r
367 </div></div>\r
368 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
369 <div class="listingblock">\r
370 <div class="content">\r
371 <pre><tt>floating_modifier Mod1</tt></pre>\r
372 </div></div>\r
373 </div>\r
374 <div class="sect2">\r
375 <h3 id="_layout_mode_for_new_containers">3.5. Layout mode for new containers</h3>\r
376 <div class="paragraph"><p>This option determines in which mode new containers will start. See also\r
377 <a href="#stack-limit">[stack-limit]</a>.</p></div>\r
378 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
379 <div class="listingblock">\r
380 <div class="content">\r
381 <pre><tt>new_container &lt;default|stacking|tabbed&gt;\r
382 new_container stack-limit &lt;cols|rows&gt; &lt;value&gt;</tt></pre>\r
383 </div></div>\r
384 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
385 <div class="listingblock">\r
386 <div class="content">\r
387 <pre><tt>new_container tabbed</tt></pre>\r
388 </div></div>\r
389 </div>\r
390 <div class="sect2">\r
391 <h3 id="_border_style_for_new_windows">3.6. Border style for new windows</h3>\r
392 <div class="paragraph"><p>This option determines which border style new windows will have.</p></div>\r
393 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
394 <div class="listingblock">\r
395 <div class="content">\r
396 <pre><tt>new_window &lt;bp|bn|bb&gt;</tt></pre>\r
397 </div></div>\r
398 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
399 <div class="listingblock">\r
400 <div class="content">\r
401 <pre><tt>new_window bp</tt></pre>\r
402 </div></div>\r
403 </div>\r
404 <div class="sect2">\r
405 <h3 id="_variables">3.7. Variables</h3>\r
406 <div class="paragraph"><p>As you learned in the section about keyboard bindings, you will have\r
407 to configure lots of bindings containing modifier keys. If you want to save\r
408 yourself some typing and be able to change the modifier you use later,\r
409 variables can be handy.</p></div>\r
410 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
411 <div class="listingblock">\r
412 <div class="content">\r
413 <pre><tt>set name value</tt></pre>\r
414 </div></div>\r
415 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
416 <div class="listingblock">\r
417 <div class="content">\r
418 <pre><tt>set $m Mod1\r
419 bindsym $m+Shift+r restart</tt></pre>\r
420 </div></div>\r
421 <div class="paragraph"><p>Variables are directly replaced in the file when parsing. There is no fancy\r
422 handling and there are absolutely no plans to change this. If you need a more\r
423 dynamic configuration you should create a little script which generates a\r
424 configuration file and run it before starting i3 (for example in your\r
425 <tt>.xsession</tt> file).</p></div>\r
426 </div>\r
427 <div class="sect2">\r
428 <h3 id="_automatically_putting_clients_on_specific_workspaces">3.8. Automatically putting clients on specific workspaces</h3>\r
429 <div class="paragraph" id="assign_workspace"><p>It is recommended that you match on window classes wherever possible because\r
430 some applications first create their window, and then worry about setting the\r
431 correct title. Firefox with Vimperator comes to mind. The window starts up\r
432 being named Firefox, and only when Vimperator is loaded does the title change.\r
433 As i3 will get the title as soon as the application maps the window (mapping\r
434 means actually displaying it on the screen), you’d need to have to match on\r
435 <em>Firefox</em> in this case.</p></div>\r
436 <div class="paragraph"><p>You can prefix or suffix workspaces with a <tt>~</tt> to specify that matching clients\r
437 should be put into floating mode. If you specify only a <tt>~</tt>, the client will\r
438 not be put onto any workspace, but will be set floating on the current one.</p></div>\r
439 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
440 <div class="listingblock">\r
441 <div class="content">\r
442 <pre><tt>assign ["]window class[/window title]["] [→] [~ | workspace]</tt></pre>\r
443 </div></div>\r
444 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
445 <div class="listingblock">\r
446 <div class="content">\r
447 <pre><tt>assign urxvt 2\r
448 assign urxvt → 2\r
449 assign "urxvt" → 2\r
450 assign "urxvt/VIM" → 3\r
451 assign "gecko" → ~4\r
452 assign "xv/MPlayer" → ~</tt></pre>\r
453 </div></div>\r
454 <div class="paragraph"><p>Note that the arrow is not required, it just looks good :-). If you decide to\r
455 use it, it has to be a UTF-8 encoded arrow, not "&#8594;" or something like that.</p></div>\r
456 </div>\r
457 <div class="sect2">\r
458 <h3 id="_automatically_starting_applications_on_i3_startup">3.9. Automatically starting applications on i3 startup</h3>\r
459 <div class="paragraph"><p>By using the <tt>exec</tt> keyword outside a keybinding, you can configure which\r
460 commands will be performed by i3 on initial startup (not when restarting i3\r
461 in-place however). These commands will be run in order.</p></div>\r
462 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
463 <div class="listingblock">\r
464 <div class="content">\r
465 <pre><tt>exec command</tt></pre>\r
466 </div></div>\r
467 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
468 <div class="listingblock">\r
469 <div class="content">\r
470 <pre><tt>exec sudo i3status | dzen2 -dock</tt></pre>\r
471 </div></div>\r
472 </div>\r
473 <div class="sect2">\r
474 <h3 id="workspace_screen">3.10. Automatically putting workspaces on specific screens</h3>\r
475 <div class="paragraph"><p>If you assign clients to workspaces, it might be handy to put the\r
476 workspaces on specific screens. Also, the assignment of workspaces to screens\r
477 will determine which workspace i3 uses for a new screen when adding screens\r
478 or when starting (e.g., by default it will use 1 for the first screen, 2 for\r
479 the second screen and so on).</p></div>\r
480 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
481 <div class="listingblock">\r
482 <div class="content">\r
483 <pre><tt>workspace &lt;number&gt; output &lt;output&gt;</tt></pre>\r
484 </div></div>\r
485 <div class="paragraph"><p>The <em>output</em> is the name of the RandR output you attach your screen to. On a\r
486 laptop, you might have VGA1 and LVDS1 as output names. You can see the\r
487 available outputs by running <tt>xrandr --current</tt>.</p></div>\r
488 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
489 <div class="listingblock">\r
490 <div class="content">\r
491 <pre><tt>workspace 1 output LVDS1\r
492 workspace 5 output VGA1</tt></pre>\r
493 </div></div>\r
494 </div>\r
495 <div class="sect2">\r
496 <h3 id="_named_workspaces">3.11. Named workspaces</h3>\r
497 <div class="paragraph"><p>If you always have a certain arrangement of workspaces, you might want to give\r
498 them names (of course UTF-8 is supported):</p></div>\r
499 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
500 <div class="listingblock">\r
501 <div class="content">\r
502 <pre><tt>workspace &lt;number&gt; &lt;name&gt;\r
503 workspace &lt;number&gt; output &lt;output&gt; name</tt></pre>\r
504 </div></div>\r
505 <div class="paragraph"><p>For more details about the <em>output</em> part of this command, see above.</p></div>\r
506 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
507 <div class="listingblock">\r
508 <div class="content">\r
509 <pre><tt>workspace 1 www\r
510 workspace 2 work\r
511 workspace 3 i ♥ workspaces</tt></pre>\r
512 </div></div>\r
513 </div>\r
514 <div class="sect2">\r
515 <h3 id="_changing_colors">3.12. Changing colors</h3>\r
516 <div class="paragraph"><p>You can change all colors which i3 uses to draw the window decorations and the\r
517 bottom bar.</p></div>\r
518 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
519 <div class="listingblock">\r
520 <div class="content">\r
521 <pre><tt>colorclass border background text</tt></pre>\r
522 </div></div>\r
523 <div class="paragraph"><p>Where colorclass can be one of:</p></div>\r
524 <div class="dlist"><dl>\r
525 <dt class="hdlist1">\r
526 client.focused\r
527 </dt>\r
528 <dd>\r
529 <p>\r
530         A client which currently has the focus.\r
531 </p>\r
532 </dd>\r
533 <dt class="hdlist1">\r
534 client.focused_inactive\r
535 </dt>\r
536 <dd>\r
537 <p>\r
538         A client which is the focused one of its container, but it does not have\r
539         the focus at the moment.\r
540 </p>\r
541 </dd>\r
542 <dt class="hdlist1">\r
543 client.unfocused\r
544 </dt>\r
545 <dd>\r
546 <p>\r
547         A client which is not the focused one of its container.\r
548 </p>\r
549 </dd>\r
550 <dt class="hdlist1">\r
551 client.urgent\r
552 </dt>\r
553 <dd>\r
554 <p>\r
555         A client which has its urgency hint activated.\r
556 </p>\r
557 </dd>\r
558 <dt class="hdlist1">\r
559 bar.focused\r
560 </dt>\r
561 <dd>\r
562 <p>\r
563         The current workspace in the bottom bar.\r
564 </p>\r
565 </dd>\r
566 <dt class="hdlist1">\r
567 bar.unfocused\r
568 </dt>\r
569 <dd>\r
570 <p>\r
571         All other workspaces in the bottom bar.\r
572 </p>\r
573 </dd>\r
574 <dt class="hdlist1">\r
575 bar.urgent\r
576 </dt>\r
577 <dd>\r
578 <p>\r
579         A workspace which has at least one client with an activated urgency hint.\r
580 </p>\r
581 </dd>\r
582 </dl></div>\r
583 <div class="paragraph"><p>You can also specify the color to be used to paint the background of the client\r
584 windows. This color will be used to paint the window on top of which the client\r
585 will be rendered.</p></div>\r
586 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
587 <div class="listingblock">\r
588 <div class="content">\r
589 <pre><tt>client.background color</tt></pre>\r
590 </div></div>\r
591 <div class="paragraph"><p>Only clients that do not cover the whole area of this window expose the color\r
592 used to paint it. If you use a color other than black for your terminals, you\r
593 most likely want to set the client background color to the same color as your\r
594 terminal program&#8217;s background color to avoid black gaps between the rendered\r
595 area of the termianal and the i3 border.</p></div>\r
596 <div class="paragraph"><p>Colors are in HTML hex format (#rrggbb), see the following example:</p></div>\r
597 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
598 <div class="listingblock">\r
599 <div class="content">\r
600 <pre><tt># class        border  backgr. text\r
601 client.focused #2F343A #900000 #FFFFFF</tt></pre>\r
602 </div></div>\r
603 <div class="paragraph"><p>Note that for the window decorations, the color around the child window is the\r
604 background color, and the border color is only the two thin lines at the top of\r
605 the window.</p></div>\r
606 </div>\r
607 <div class="sect2">\r
608 <h3 id="_interprocess_communication">3.13. Interprocess communication</h3>\r
609 <div class="paragraph"><p>i3 uses unix sockets to provide an IPC interface. This allows third-party\r
610 programs to get information from i3, such as the current workspaces\r
611 (to display a workspace bar), and to control i3.</p></div>\r
612 <div class="paragraph"><p>To enable it, you have to configure a path where the unix socket will be\r
613 stored. The default path is <tt>~/.i3/ipc.sock</tt>.</p></div>\r
614 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
615 <div class="listingblock">\r
616 <div class="content">\r
617 <pre><tt>ipc-socket ~/.i3/ipc.sock</tt></pre>\r
618 </div></div>\r
619 <div class="paragraph"><p>You can then use the <tt>i3-msg</tt> application to perform any command listed in\r
620 the next section.</p></div>\r
621 </div>\r
622 <div class="sect2">\r
623 <h3 id="_disable_focus_follows_mouse">3.14. Disable focus follows mouse</h3>\r
624 <div class="paragraph"><p>If you have a setup where your mouse usually is in your way (like a touchpad\r
625 on your laptop which you do not want to disable completely), you might want\r
626 to disable <em>focus follows mouse</em> and control focus only by using your keyboard.\r
627 The mouse will still be useful inside the currently active window (for example\r
628 to click on links in your browser window).</p></div>\r
629 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
630 <div class="listingblock">\r
631 <div class="content">\r
632 <pre><tt>focus_follows_mouse &lt;yes|no&gt;</tt></pre>\r
633 </div></div>\r
634 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
635 <div class="listingblock">\r
636 <div class="content">\r
637 <pre><tt>focus_follows_mouse no</tt></pre>\r
638 </div></div>\r
639 </div>\r
640 <div class="sect2">\r
641 <h3 id="_internal_workspace_bar">3.15. Internal workspace bar</h3>\r
642 <div class="paragraph"><p>The internal workspace bar (the thing at the bottom of your screen) is very\r
643 simple&#8201;&#8212;&#8201;it does not provide a way to display custom text and it does not\r
644 offer advanced customization features. This is intended because we do not\r
645 want to duplicate functionality of tools like <tt>dzen2</tt>, <tt>xmobar</tt> and so on\r
646 (they render bars, we manage windows). Instead, there is an option which will\r
647 turn off the internal bar completely, so that you can use a separate program to\r
648 display it (see <tt>i3-wsbar</tt>, a sample implementation of such a program):</p></div>\r
649 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
650 <div class="listingblock">\r
651 <div class="content">\r
652 <pre><tt>workspace_bar &lt;yes|no&gt;</tt></pre>\r
653 </div></div>\r
654 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
655 <div class="listingblock">\r
656 <div class="content">\r
657 <pre><tt>workspace_bar no</tt></pre>\r
658 </div></div>\r
659 </div>\r
660 </div>\r
661 </div>\r
662 <div class="sect1">\r
663 <h2 id="_list_of_commands">4. List of commands</h2>\r
664 <div class="sectionbody">\r
665 <div class="sect2">\r
666 <h3 id="_manipulating_layout">4.1. Manipulating layout</h3>\r
667 <div class="paragraph"><p>To change the layout of the current container to stacking, use <tt>s</tt>, for default\r
668 use <tt>d</tt> and for tabbed, use <tt>T</tt>. To make the current client (!) fullscreen,\r
669 use <tt>f</tt>, to make it span all outputs, use <tt>fg</tt>, to make it floating (or\r
670 tiling again) use <tt>t</tt>:</p></div>\r
671 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
672 <div class="listingblock">\r
673 <div class="content">\r
674 <pre><tt>bindsym Mod1+s s\r
675 bindsym Mod1+l d\r
676 bindsym Mod1+w T\r
677 \r
678 # Toggle fullscreen\r
679 bindsym Mod1+f f\r
680 \r
681 # Toggle global fullscreen\r
682 bindsym Mod1+Shift+f fg\r
683 \r
684 # Toggle floating/tiling\r
685 bindsym Mod1+t t</tt></pre>\r
686 </div></div>\r
687 </div>\r
688 <div class="sect2">\r
689 <h3 id="_focusing_moving_snapping_clients_containers_screens">4.2. Focusing/Moving/Snapping clients/containers/screens</h3>\r
690 <div class="paragraph"><p>To change the focus, use one of the <tt>h</tt>, <tt>j</tt>, <tt>k</tt> and <tt>l</tt> commands, meaning\r
691 left, down, up, right (respectively). To focus a container, prefix it with\r
692 <tt>wc</tt>. To focus a screen, prefix it with <tt>ws</tt>.</p></div>\r
693 <div class="paragraph"><p>The same principle applies for moving and snapping: just prefix the command\r
694 with <tt>m</tt> when moving and with <tt>s</tt> when snapping:</p></div>\r
695 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
696 <div class="listingblock">\r
697 <div class="content">\r
698 <pre><tt># Focus clients on the left, bottom, top, right:\r
699 bindsym Mod1+j h\r
700 bindsym Mod1+k j\r
701 bindsym Mod1+j k\r
702 bindsym Mod1+semicolon l\r
703 \r
704 # Move client to the left, bottom, top, right:\r
705 bindsym Mod1+j mh\r
706 bindsym Mod1+k mj\r
707 bindsym Mod1+j mk\r
708 bindsym Mod1+semicolon ml\r
709 \r
710 # Snap client to the left, bottom, top, right:\r
711 bindsym Mod1+j sh\r
712 bindsym Mod1+k sj\r
713 bindsym Mod1+j sk\r
714 bindsym Mod1+semicolon sl\r
715 \r
716 # Focus container on the left, bottom, top, right:\r
717 bindsym Mod3+j wch\r
718 …</tt></pre>\r
719 </div></div>\r
720 </div>\r
721 <div class="sect2">\r
722 <h3 id="_changing_workspaces_moving_clients_to_workspaces">4.3. Changing workspaces/moving clients to workspaces</h3>\r
723 <div class="paragraph"><p>To change to a specific workspace, the command is just the number of the\r
724 workspace, e.g. <tt>1</tt> or <tt>3</tt>. To move the current client to a specific workspace,\r
725 prefix the number with an <tt>m</tt>.</p></div>\r
726 <div class="paragraph"><p>You can also switch to the next and previous workspace with the commands <tt>nw</tt>\r
727 and <tt>pw</tt>, which is handy, for example, if you have workspace 1, 3, 4 and 9 and\r
728 you want to cycle through them with a single key combination.</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>bindsym Mod1+1 1\r
733 bindsym Mod1+2 2\r
734 ...\r
735 \r
736 bindsym Mod1+Shift+1 m1\r
737 bindsym Mod1+Shift+2 m2\r
738 ...\r
739 \r
740 bindsym Mod1+o nw\r
741 bindsym Mod1+p pw</tt></pre>\r
742 </div></div>\r
743 </div>\r
744 <div class="sect2">\r
745 <h3 id="resizingconfig">4.4. Resizing columns/rows</h3>\r
746 <div class="paragraph"><p>If you want to resize columns/rows using your keyboard, you can use the\r
747 <tt>resize</tt> command, I recommend using it inside a so called <tt>mode</tt>:</p></div>\r
748 <div class="listingblock">\r
749 <div class="title">Example: Configuration file, defining a mode for resizing</div>\r
750 <div class="content">\r
751 <pre><tt>mode "resize" {\r
752         # These bindings trigger as soon as you enter the resize mode\r
753 \r
754         # They resize the border in the direction you pressed, e.g.\r
755         # when pressing left, the window is resized so that it has\r
756         # more space on its left\r
757 \r
758         bindsym n resize left -10\r
759         bindsym Shift+n resize left +10\r
760 \r
761         bindsym r resize bottom +10\r
762         bindsym Shift+r resize bottom -10\r
763 \r
764         bindsym t resize top -10\r
765         bindsym Shift+t resize top +10\r
766 \r
767         bindsym d resize right +10\r
768         bindsym Shift+d resize right -10\r
769 \r
770         bind 36 mode default\r
771 }\r
772 \r
773 # Enter resize mode\r
774 bindsym Mod1+r mode resize</tt></pre>\r
775 </div></div>\r
776 </div>\r
777 <div class="sect2">\r
778 <h3 id="_jumping_to_specific_windows">4.5. Jumping to specific windows</h3>\r
779 <div class="paragraph"><p>Often when in a multi-monitor environment, you want to quickly jump to a\r
780 specific window. For example, while working on workspace 3 you may want to\r
781 jump to your mail client to email your boss that you’ve achieved some\r
782 important goal. Instead of figuring out how to navigate to your mailclient,\r
783 it would be more convenient to have a shortcut.</p></div>\r
784 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
785 <div class="listingblock">\r
786 <div class="content">\r
787 <pre><tt>jump ["]window class[/window title]["]\r
788 jump workspace [ column row ]</tt></pre>\r
789 </div></div>\r
790 <div class="paragraph"><p>You can either use the same matching algorithm as in the <tt>assign</tt> command\r
791 (see above) or you can specify the position of the client if you always use\r
792 the same layout.</p></div>\r
793 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
794 <div class="listingblock">\r
795 <div class="content">\r
796 <pre><tt># Get me to the next open VIM instance\r
797 bindsym Mod1+a jump "urxvt/VIM"</tt></pre>\r
798 </div></div>\r
799 </div>\r
800 <div class="sect2">\r
801 <h3 id="_vim_like_marks_mark_goto">4.6. VIM-like marks (mark/goto)</h3>\r
802 <div class="paragraph" id="vim_like_marks"><p>This feature is like the jump feature: It allows you to directly jump to a\r
803 specific window (this means switching to the appropriate workspace and setting\r
804 focus to the windows). However, you can directly mark a specific window with\r
805 an arbitrary label and use it afterwards.  You do not need to ensure that your\r
806 windows have unique classes or titles, and you do not need to change your\r
807 configuration file.</p></div>\r
808 <div class="paragraph"><p>As the command needs to include the label with which you want to mark the\r
809 window, you cannot simply bind it to a key.  <tt>i3-input</tt> is a tool created\r
810 for this purpose: It lets you input a command and sends the command to i3. It\r
811 can also prefix this command and display a custom prompt for the input dialog.</p></div>\r
812 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
813 <div class="listingblock">\r
814 <div class="content">\r
815 <pre><tt>mark &lt;identifier&gt;\r
816 goto &lt;identifier&gt;</tt></pre>\r
817 </div></div>\r
818 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
819 <div class="listingblock">\r
820 <div class="content">\r
821 <pre><tt># Read 1 character and mark the current window with this character\r
822 bindsym Mod1+m exec i3-input -p 'mark ' -l 1 -P 'Mark: '\r
823 \r
824 # Read 1 character and go to the window with the character\r
825 bindsym Mod1+g exec i3-input -p 'goto ' -l 1 -P 'Goto: '</tt></pre>\r
826 </div></div>\r
827 <div class="paragraph"><p>Alternatively, if you do not want to mess with <tt>i3-input</tt>, you could create\r
828 seperate bindings for a specific set of labels and then only use those labels.</p></div>\r
829 </div>\r
830 <div class="sect2">\r
831 <h3 id="_traveling_the_focus_stack">4.7. Traveling the focus stack</h3>\r
832 <div class="paragraph"><p>This mechanism can be thought of as the opposite of the <tt>jump</tt> command.\r
833 It travels the focus stack and jumps to the window which had focus previously.</p></div>\r
834 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
835 <div class="listingblock">\r
836 <div class="content">\r
837 <pre><tt>focus [number] | floating | tiling | ft</tt></pre>\r
838 </div></div>\r
839 <div class="paragraph"><p>Where <tt>number</tt> by default is 1 meaning that the next client in the focus stack\r
840 will be selected.</p></div>\r
841 <div class="paragraph"><p>The special values have the following meaning:</p></div>\r
842 <div class="dlist"><dl>\r
843 <dt class="hdlist1">\r
844 floating\r
845 </dt>\r
846 <dd>\r
847 <p>\r
848         The next floating window is selected.\r
849 </p>\r
850 </dd>\r
851 <dt class="hdlist1">\r
852 tiling\r
853 </dt>\r
854 <dd>\r
855 <p>\r
856         The next tiling window is selected.\r
857 </p>\r
858 </dd>\r
859 <dt class="hdlist1">\r
860 ft\r
861 </dt>\r
862 <dd>\r
863 <p>\r
864         If the current window is floating, the next tiling window will be\r
865        selected; and vice-versa.\r
866 </p>\r
867 </dd>\r
868 </dl></div>\r
869 </div>\r
870 <div class="sect2">\r
871 <h3 id="_changing_border_style">4.8. Changing border style</h3>\r
872 <div class="paragraph"><p>To change the border of the current client, you can use <tt>bn</tt> to use the normal\r
873 border (including window title), <tt>bp</tt> to use a 1-pixel border (no window title)\r
874 and <tt>bb</tt> to make the client borderless. There is also <tt>bt</tt> which will toggle\r
875 the different border styles.</p></div>\r
876 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
877 <div class="listingblock">\r
878 <div class="content">\r
879 <pre><tt>bindsym Mod1+t bn\r
880 bindsym Mod1+y bp\r
881 bindsym Mod1+u bb</tt></pre>\r
882 </div></div>\r
883 </div>\r
884 <div class="sect2">\r
885 <h3 id="stack-limit">4.9. Changing the stack-limit of a container</h3>\r
886 <div class="paragraph"><p>If you have a single container with a lot of windows inside it (say, more than\r
887 10), the default layout of a stacking container can get a little unhandy.\r
888 Depending on your screen’s size, you might end up seeing only half of the\r
889 titlebars for each window in the container.</p></div>\r
890 <div class="paragraph"><p>Using the <tt>stack-limit</tt> command, you can limit the number of rows or columns\r
891 in a stacking container. i3 will create columns or rows (depending on what\r
892 you limited) automatically as needed.</p></div>\r
893 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
894 <div class="listingblock">\r
895 <div class="content">\r
896 <pre><tt>stack-limit &lt;cols|rows&gt; &lt;value&gt;</tt></pre>\r
897 </div></div>\r
898 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
899 <div class="listingblock">\r
900 <div class="content">\r
901 <pre><tt># I always want to have two window titles in one line\r
902 stack-limit cols 2\r
903 \r
904 # Not more than 5 rows in this stacking container\r
905 stack-limit rows 5</tt></pre>\r
906 </div></div>\r
907 <div class="paragraph"><p><span class="image">\r
908 <img src="stacklimit.png" alt="Container limited to two columns" />\r
909 </span></p></div>\r
910 </div>\r
911 <div class="sect2">\r
912 <h3 id="_reloading_restarting_exiting">4.10. Reloading/Restarting/Exiting</h3>\r
913 <div class="paragraph"><p>You can make i3 reload its configuration file with <tt>reload</tt>. You can also\r
914 restart i3 inplace with the <tt>restart</tt> command to get it out of some weird state\r
915 (if that should ever happen) or to perform an upgrade without having to restart\r
916 your X session. However, your layout is not preserved at the moment, meaning\r
917 that all open windows will end up in a single container in default layout\r
918 after the restart. To exit i3 properly, you can use the <tt>exit</tt> command,\r
919 however you don’t need to (simply killing your X session is fine as well).</p></div>\r
920 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
921 <div class="listingblock">\r
922 <div class="content">\r
923 <pre><tt>bindsym Mod1+Shift+r restart\r
924 bindsym Mod1+Shift+w reload\r
925 bindsym Mod1+Shift+e exit</tt></pre>\r
926 </div></div>\r
927 </div>\r
928 </div>\r
929 </div>\r
930 <div class="sect1">\r
931 <h2 id="multi_monitor">5. Multiple monitors</h2>\r
932 <div class="sectionbody">\r
933 <div class="paragraph"><p>As you can see in the goal list on the website, i3 was specifically developed\r
934 with support for multiple monitors in mind. This section will explain how to\r
935 handle multiple monitors.</p></div>\r
936 <div class="paragraph"><p>When you have only one monitor, things are simple. You usually start with\r
937 workspace 1 on your monitor and open new ones as you need them.</p></div>\r
938 <div class="paragraph"><p>When you have more than one monitor, each monitor will get an initial\r
939 workspace.  The first monitor gets 1, the second gets 2 and a possible third\r
940 would get 3. When you switch to a workspace on a different monitor, i3 will\r
941 switch to that monitor and then switch to the workspace. This way, you don’t\r
942 need shortcuts to switch to a specific monitor, and you don’t need to remember\r
943 where you put which workspace. New workspaces will be opened on the currently\r
944 active monitor.  It is not possible to have a monitor without a workspace.</p></div>\r
945 <div class="paragraph"><p>The idea of making workspaces global is based on the observation that most\r
946 users have a very limited set of workspaces on their additional monitors.\r
947 They are often used for a specific task (browser, shell) or for monitoring\r
948 several things (mail, IRC, syslog, …). Thus, using one workspace on one monitor\r
949 and "the rest" on the other monitors often makes sense. However, as you can\r
950 create an unlimited number of workspaces in i3 and tie them to specific\r
951 screens, you can have the "traditional" approach of having X workspaces per\r
952 screen by changing your configuration (using modes, for example).</p></div>\r
953 <div class="sect2">\r
954 <h3 id="_configuring_your_monitors">5.1. Configuring your monitors</h3>\r
955 <div class="paragraph"><p>To help you get going if you have never used multiple monitors before, here is\r
956 a short overview of the xrandr options which will probably be of interest to\r
957 you. It is always useful to get an overview of the current screen configuration.\r
958 Just run "xrandr" and you will get an output like the following:</p></div>\r
959 <div class="listingblock">\r
960 <div class="content">\r
961 <pre><tt>$ xrandr\r
962 Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192\r
963 VGA1 disconnected (normal left inverted right x axis y axis)\r
964 LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm\r
965    1280x800       60.0*+   50.0\r
966    1024x768       85.0     75.0     70.1     60.0\r
967    832x624        74.6\r
968    800x600        85.1     72.2     75.0     60.3     56.2\r
969    640x480        85.0     72.8     75.0     59.9\r
970    720x400        85.0\r
971    640x400        85.1\r
972    640x350        85.1</tt></pre>\r
973 </div></div>\r
974 <div class="paragraph"><p>Several things are important here: You can see that <tt>LVDS1</tt> is connected (of\r
975 course, it is the internal flat panel) but <tt>VGA1</tt> is not. If you have a monitor\r
976 connected to one of the ports but xrandr still says "disconnected", you should\r
977 check your cable, monitor or graphics driver.</p></div>\r
978 <div class="paragraph"><p>The maximum resolution you can see at the end of the first line is the maximum\r
979 combined resolution of your monitors. By default, it is usually too low and has\r
980 to be increased by editing <tt>/etc/X11/xorg.conf</tt>.</p></div>\r
981 <div class="paragraph"><p>So, say you connected VGA1 and want to use it as an additional screen:</p></div>\r
982 <div class="listingblock">\r
983 <div class="content">\r
984 <pre><tt>xrandr --output VGA1 --auto --left-of LVDS1</tt></pre>\r
985 </div></div>\r
986 <div class="paragraph"><p>This command makes xrandr try to find the native resolution of the device\r
987 connected to <tt>VGA1</tt> and configures it to the left of your internal flat panel.\r
988 When running "xrandr" again, the output looks like this:</p></div>\r
989 <div class="listingblock">\r
990 <div class="content">\r
991 <pre><tt>$ xrandr\r
992 Screen 0: minimum 320 x 200, current 2560 x 1024, maximum 8192 x 8192\r
993 VGA1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm\r
994    1280x1024      60.0*+   75.0\r
995    1280x960       60.0\r
996    1152x864       75.0\r
997    1024x768       75.1     70.1     60.0\r
998    832x624        74.6\r
999    800x600        72.2     75.0     60.3     56.2\r
1000    640x480        72.8     75.0     66.7     60.0\r
1001    720x400        70.1\r
1002 LVDS1 connected 1280x800+1280+0 (normal left inverted right x axis y axis) 261mm x 163mm\r
1003    1280x800       60.0*+   50.0\r
1004    1024x768       85.0     75.0     70.1     60.0\r
1005    832x624        74.6\r
1006    800x600        85.1     72.2     75.0     60.3     56.2\r
1007    640x480        85.0     72.8     75.0     59.9\r
1008    720x400        85.0\r
1009    640x400        85.1\r
1010    640x350        85.1</tt></pre>\r
1011 </div></div>\r
1012 <div class="paragraph"><p>Please note that i3 uses exactly the same API as xrandr does, so it will see\r
1013 only what you can see in xrandr.</p></div>\r
1014 <div class="paragraph"><p>See also <a href="#presentations">[presentations]</a> for more examples of multi-monitor setups.</p></div>\r
1015 </div>\r
1016 <div class="sect2">\r
1017 <h3 id="_interesting_configuration_for_multi_monitor_environments">5.2. Interesting configuration for multi-monitor environments</h3>\r
1018 <div class="paragraph"><p>There are several things to configure in i3 which may be interesting if you\r
1019 have more than one monitor:</p></div>\r
1020 <div class="olist arabic"><ol class="arabic">\r
1021 <li>\r
1022 <p>\r
1023 You can specify which workspace should be put on which screen. This\r
1024    allows you to have a different set of workspaces when starting than just\r
1025    1 for the first monitor, 2 for the second and so on. See\r
1026    <a href="#workspace_screen">[workspace_screen]</a>.\r
1027 </p>\r
1028 </li>\r
1029 <li>\r
1030 <p>\r
1031 If you want some applications to generally open on the bigger screen\r
1032    (MPlayer, Firefox, …), you can assign them to a specific workspace, see\r
1033    <a href="#assign_workspace">[assign_workspace]</a>.\r
1034 </p>\r
1035 </li>\r
1036 <li>\r
1037 <p>\r
1038 If you have many workspaces on many monitors, it might get hard to keep\r
1039    track of which window you put where. Thus, you can use vim-like marks to\r
1040    quickly switch between windows. See <a href="#vim_like_marks">[vim_like_marks]</a>.\r
1041 </p>\r
1042 </li>\r
1043 </ol></div>\r
1044 </div>\r
1045 </div>\r
1046 </div>\r
1047 <div class="sect1">\r
1048 <h2 id="_i3_and_the_rest_of_your_software_world">6. i3 and the rest of your software world</h2>\r
1049 <div class="sectionbody">\r
1050 <div class="sect2">\r
1051 <h3 id="_displaying_a_status_line">6.1. Displaying a status line</h3>\r
1052 <div class="paragraph"><p>A very common thing amongst users of exotic window managers is a status line at\r
1053 some corner of the screen. It is an often superior replacement to the widget\r
1054 approach you have in the task bar of a traditional desktop environment.</p></div>\r
1055 <div class="paragraph"><p>If you don’t already have your favorite way of generating such a status line\r
1056 (self-written scripts, conky, …), then i3status is the recommended tool for\r
1057 this task. It was written in C with the goal of using as few syscalls as\r
1058 possible to reduce the time your CPU is woken up from sleep states.</p></div>\r
1059 <div class="paragraph"><p>Regardless of which application you use to generate the status line, you\r
1060 want to make sure that the application does one of the following things:</p></div>\r
1061 <div class="olist arabic"><ol class="arabic">\r
1062 <li>\r
1063 <p>\r
1064 Register as a dock window using EWMH hints. This will make i3 position the\r
1065    window above the workspace bar but below every other client. This is the\r
1066    recommended way, but in case of dzen2, for example, you need to check out\r
1067    the source of dzen2 from subversion, as the -dock option is not present\r
1068    in the released versions.\r
1069 </p>\r
1070 </li>\r
1071 <li>\r
1072 <p>\r
1073 Overlay the internal workspace bar. This method will not waste any space\r
1074    on the workspace bar, however, it is rather hackish. Just configure\r
1075    the output window to be over the workspace bar (say -x 200 and -y 780 if\r
1076    your screen is 800 px height).\r
1077 </p>\r
1078 </li>\r
1079 </ol></div>\r
1080 <div class="paragraph"><p>The planned solution for this problem is to make the workspace bar optional\r
1081 and switch to a third party application completely (dzen2 for example)\r
1082 which will then contain the workspace bar.</p></div>\r
1083 </div>\r
1084 <div class="sect2">\r
1085 <h3 id="_giving_presentations_multi_monitor">6.2. Giving presentations (multi-monitor)</h3>\r
1086 <div class="paragraph"><p>When giving a presentation, you typically want the audience to see what you see\r
1087 on your screen and then go through a series of slides (if the presentation is\r
1088 simple). For more complex presentations, you might want to have some notes\r
1089 which only you can see on your screen, while the audience can only see the\r
1090 slides.</p></div>\r
1091 <div class="sect3">\r
1092 <h4 id="presentations">6.2.1. Case 1: everybody gets the same output</h4>\r
1093 <div class="paragraph"><p>This is the simple case. You connect your computer to the video projector,\r
1094 turn on both (computer and video projector) and configure your X server to\r
1095 clone the internal flat panel of your computer to the video output:</p></div>\r
1096 <div class="listingblock">\r
1097 <div class="content">\r
1098 <pre><tt>xrandr --output VGA1 --mode 1024x768 --same-as LVDS1</tt></pre>\r
1099 </div></div>\r
1100 <div class="paragraph"><p>i3 will then use the lowest common subset of screen resolutions, the rest of\r
1101 your screen will be left untouched (it will show the X background). So, in\r
1102 our example, this would be 1024x768 (my notebook has 1280x800).</p></div>\r
1103 </div>\r
1104 <div class="sect3">\r
1105 <h4 id="_case_2_you_can_see_more_than_your_audience">6.2.2. Case 2: you can see more than your audience</h4>\r
1106 <div class="paragraph"><p>This case is a bit harder. First of all, you should configure the VGA output\r
1107 somewhere near your internal flat panel, say right of it:</p></div>\r
1108 <div class="listingblock">\r
1109 <div class="content">\r
1110 <pre><tt>xrandr --output VGA1 --mode 1024x768 --right-of LVDS1</tt></pre>\r
1111 </div></div>\r
1112 <div class="paragraph"><p>Now, i3 will put a new workspace (depending on your settings) on the new screen\r
1113 and you are in multi-monitor mode (see <a href="#multi_monitor">[multi_monitor]</a>).</p></div>\r
1114 <div class="paragraph"><p>Because i3 is not a compositing window manager, there is no ability to\r
1115 display a window on two screens at the same time. Instead, your presentation\r
1116 software needs to do this job (that is, open a window on each screen).</p></div>\r
1117 </div>\r
1118 </div>\r
1119 </div>\r
1120 </div>\r
1121 </div>\r
1122 <div id="footnotes"><hr /></div>\r
1123 <div id="footer">\r
1124 <div id="footer-text">\r
1125 Last updated 2011-07-22 20:28:05 CEST\r
1126 </div>\r
1127 </div>\r
1128 </body>\r
1129 </html>\r