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