]> git.sur5r.net Git - i3/i3.github.io/blob - docs/userguide.html
update docs for 4.14
[i3/i3.github.io] / docs / userguide.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
2     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
4 <head>\r
5 <link rel="icon" type="image/x-icon" href="/favicon.ico">\r
6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
7 <meta name="generator" content="AsciiDoc 8.6.9" />\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 document.addEventListener("DOMContentLoaded", function(){asciidoc.footnotes(); asciidoc.toc(2);}, false);\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="https://www.reddit.com/r/i3wm/">FAQ</a></li>\r
26                                 <li><a href="/contact">Contact</a></li>\r
27                                 <li><a href="https://github.com/i3/i3/issues">Bugs</a></li>\r
28                         </ul>\r
29         <br style="clear: both">\r
30 <div id="content">\r
31 <div id="header">\r
32 <h1>i3 User’s Guide</h1>\r
33 <span id="author">Michael Stapelberg</span><br />\r
34 <span id="email"><tt>&lt;<a href="mailto:michael@i3wm.org">michael@i3wm.org</a>&gt;</tt></span><br />\r
35 <span id="revdate">March 2013</span>\r
36 <div id="toc">
37   <div id="toctitle">Table of Contents</div>
38   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
39 </div>\r
40 </div>\r
41 <div id="preamble">\r
42 <div class="sectionbody">\r
43 <div class="paragraph"><p>This document contains all the information you need to configure and use the i3\r
44 window manager. If it does not, please check <a href="https://www.reddit.com/r/i3wm/">https://www.reddit.com/r/i3wm/</a>\r
45 first, then contact us on IRC (preferred) or post your question(s) on the\r
46 mailing list.</p></div>\r
47 </div>\r
48 </div>\r
49 <div class="sect1">\r
50 <h2 id="_default_keybindings">1. Default keybindings</h2>\r
51 <div class="sectionbody">\r
52 <div class="paragraph"><p>For the "too long; didn’t read" people, here is an overview of the default\r
53 keybindings (click to see the full size image):</p></div>\r
54 <div class="paragraph"><p><strong>Keys to use with $mod (Alt):</strong></p></div>\r
55 <div class="paragraph"><p><span class="image">\r
56 <a class="image" href="keyboard-layer1.png">\r
57 <img src="keyboard-layer1.png" alt="Keys to use with $mod (Alt)" width="600" />\r
58 </a>\r
59 </span></p></div>\r
60 <div class="paragraph"><p><strong>Keys to use with Shift+$mod:</strong></p></div>\r
61 <div class="paragraph"><p><span class="image">\r
62 <a class="image" href="keyboard-layer2.png">\r
63 <img src="keyboard-layer2.png" alt="Keys to use with Shift+$mod" width="600" />\r
64 </a>\r
65 </span></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 class="paragraph"><p>Note that when starting i3 without a config file, i3-config-wizard will offer\r
69 you to create a config file in which the key positions (!) match what you see\r
70 in the image above, regardless of the keyboard layout you are using. If you\r
71 prefer to use a config file where the key letters match what you are seeing\r
72 above, just decline i3-config-wizard’s offer and base your config on\r
73 <tt>/etc/i3/config</tt>.</p></div>\r
74 </div>\r
75 </div>\r
76 <div class="sect1">\r
77 <h2 id="_using_i3">2. Using i3</h2>\r
78 <div class="sectionbody">\r
79 <div class="paragraph"><p>Throughout this guide, the keyword <tt>$mod</tt> will be used to refer to the\r
80 configured modifier. This is the Alt key (<tt>Mod1</tt>) by default, with the Windows\r
81 key (<tt>Mod4</tt>) being a popular alternative.</p></div>\r
82 <div class="sect2">\r
83 <h3 id="_opening_terminals_and_moving_around">2.1. Opening terminals and moving around</h3>\r
84 <div class="paragraph"><p>One very basic operation is opening a new terminal. By default, the keybinding\r
85 for this is <tt>$mod+Enter</tt>, that is Alt+Enter (<tt>Mod1+Enter</tt>) in the default\r
86 configuration. By pressing <tt>$mod+Enter</tt>, a new terminal will be opened.  It\r
87 will fill the whole space available on your screen.</p></div>\r
88 <div class="paragraph"><p><span class="image">\r
89 <img src="single_terminal.png" alt="Single terminal" />\r
90 </span></p></div>\r
91 <div class="paragraph"><p>If you now open another terminal, i3 will place it next to the current one,\r
92 splitting the screen size in half. Depending on your monitor, i3 will put the\r
93 created window beside the existing window (on wide displays) or below the\r
94 existing window (rotated displays).</p></div>\r
95 <div class="paragraph"><p><span class="image">\r
96 <img src="two_terminals.png" alt="Two terminals" />\r
97 </span></p></div>\r
98 <div class="paragraph"><p>To move the focus between the two terminals, you can use the direction keys\r
99 which you may know from the editor <tt>vi</tt>. However, in i3, your homerow is used\r
100 for these keys (in <tt>vi</tt>, the keys are shifted to the left by one for\r
101 compatibility with most keyboard layouts). Therefore, <tt>$mod+j</tt> is left, <tt>$mod+k</tt>\r
102 is down, <tt>$mod+l</tt> is up and <tt>$mod+;</tt> is right. So, to switch between the\r
103 terminals, use <tt>$mod+k</tt> or <tt>$mod+l</tt>. Of course, you can also use the arrow keys.</p></div>\r
104 <div class="paragraph"><p>At the moment, your workspace is split (it contains two terminals) in a\r
105 specific direction (horizontal by default). Every window can be split\r
106 horizontally or vertically again, just like the workspace. The terminology is\r
107 "window" for a container that actually contains an X11 window (like a terminal\r
108 or browser) and "split container" for containers that consist of one or more\r
109 windows.</p></div>\r
110 <div class="paragraph"><p>TODO: picture of the tree</p></div>\r
111 <div class="paragraph"><p>To split a window vertically, press <tt>$mod+v</tt> before you create the new window.\r
112 To split it horizontally, press <tt>$mod+h</tt>.</p></div>\r
113 </div>\r
114 <div class="sect2">\r
115 <h3 id="_changing_the_container_layout">2.2. Changing the container layout</h3>\r
116 <div class="paragraph"><p>A split container can have one of the following layouts:</p></div>\r
117 <div class="dlist"><dl>\r
118 <dt class="hdlist1">\r
119 splith/splitv\r
120 </dt>\r
121 <dd>\r
122 <p>\r
123 Windows are sized so that every window gets an equal amount of space in the\r
124 container. splith distributes the windows horizontally (windows are right next\r
125 to each other), splitv distributes them vertically (windows are on top of each\r
126 other).\r
127 </p>\r
128 </dd>\r
129 <dt class="hdlist1">\r
130 stacking\r
131 </dt>\r
132 <dd>\r
133 <p>\r
134 Only the focused window in the container is displayed. You get a list of\r
135 windows at the top of the container.\r
136 </p>\r
137 </dd>\r
138 <dt class="hdlist1">\r
139 tabbed\r
140 </dt>\r
141 <dd>\r
142 <p>\r
143 The same principle as <tt>stacking</tt>, but the list of windows at the top is only\r
144 a single line which is vertically split.\r
145 </p>\r
146 </dd>\r
147 </dl></div>\r
148 <div class="paragraph"><p>To switch modes, press <tt>$mod+e</tt> for splith/splitv (it toggles), <tt>$mod+s</tt> for\r
149 stacking and <tt>$mod+w</tt> for tabbed.</p></div>\r
150 <div class="paragraph"><p><span class="image">\r
151 <img src="modes.png" alt="Container modes" />\r
152 </span></p></div>\r
153 </div>\r
154 <div class="sect2">\r
155 <h3 id="_toggling_fullscreen_mode_for_a_window">2.3. Toggling fullscreen mode for a window</h3>\r
156 <div class="paragraph"><p>To display a window in fullscreen mode or to go out of fullscreen mode again,\r
157 press <tt>$mod+f</tt>.</p></div>\r
158 <div class="paragraph"><p>There is also a global fullscreen mode in i3 in which the client will span all\r
159 available outputs (the command is <tt>fullscreen toggle global</tt>).</p></div>\r
160 </div>\r
161 <div class="sect2">\r
162 <h3 id="_opening_other_applications">2.4. Opening other applications</h3>\r
163 <div class="paragraph"><p>Aside from opening applications from a terminal, you can also use the handy\r
164 <tt>dmenu</tt> which is opened by pressing <tt>$mod+d</tt> by default. Just type the name\r
165 (or a part of it) of the application which you want to open. The corresponding\r
166 application has to be in your <tt>$PATH</tt> for this to work.</p></div>\r
167 <div class="paragraph"><p>Additionally, if you have applications you open very frequently, you can\r
168 create a keybinding for starting the application directly. See the section\r
169 <a href="#configuring">[configuring]</a> for details.</p></div>\r
170 </div>\r
171 <div class="sect2">\r
172 <h3 id="_closing_windows">2.5. Closing windows</h3>\r
173 <div class="paragraph"><p>If an application does not provide a mechanism for closing (most applications\r
174 provide a menu, the escape key or a shortcut like <tt>Control+w</tt> to close), you\r
175 can press <tt>$mod+Shift+q</tt> to kill a window. For applications which support\r
176 the WM_DELETE protocol, this will correctly close the application (saving\r
177 any modifications or doing other cleanup). If the application doesn’t support\r
178 the WM_DELETE protocol your X server will kill the window and the behaviour\r
179 depends on the application.</p></div>\r
180 </div>\r
181 <div class="sect2">\r
182 <h3 id="_using_workspaces">2.6. Using workspaces</h3>\r
183 <div class="paragraph"><p>Workspaces are an easy way to group a set of windows. By default, you are on\r
184 the first workspace, as the bar on the bottom left indicates. To switch to\r
185 another workspace, press <tt>$mod+num</tt> where <tt>num</tt> is the number of the workspace\r
186 you want to use. If the workspace does not exist yet, it will be created.</p></div>\r
187 <div class="paragraph"><p>A common paradigm is to put the web browser on one workspace, communication\r
188 applications (<tt>mutt</tt>, <tt>irssi</tt>, &#8230;) on another one, and the ones with which you\r
189 work, on the third one. Of course, there is no need to follow this approach.</p></div>\r
190 <div class="paragraph"><p>If you have multiple screens, a workspace will be created on each screen at\r
191 startup. If you open a new workspace, it will be bound to the screen you\r
192 created it on.  When you switch to a workspace on another screen, i3 will set\r
193 focus to that screen.</p></div>\r
194 </div>\r
195 <div class="sect2">\r
196 <h3 id="_moving_windows_to_workspaces">2.7. Moving windows to workspaces</h3>\r
197 <div class="paragraph"><p>To move a window to another workspace, simply press <tt>$mod+Shift+num</tt> where\r
198 <tt>num</tt> is (like when switching workspaces) the number of the target workspace.\r
199 Similarly to switching workspaces, the target workspace will be created if\r
200 it does not yet exist.</p></div>\r
201 </div>\r
202 <div class="sect2">\r
203 <h3 id="_resizing">2.8. Resizing</h3>\r
204 <div class="paragraph"><p>The easiest way to resize a container is by using the mouse: Grab the border\r
205 and move it to the wanted size.</p></div>\r
206 <div class="paragraph"><p>You can also use <a href="#binding_modes">[binding_modes]</a> to define a mode for resizing via the\r
207 keyboard. To see an example for this, look at the\r
208 <a href="https://github.com/i3/i3/blob/next/etc/config.keycodes">default config</a> provided\r
209 by i3.</p></div>\r
210 </div>\r
211 <div class="sect2">\r
212 <h3 id="_restarting_i3_inplace">2.9. Restarting i3 inplace</h3>\r
213 <div class="paragraph"><p>To restart i3 in place (and thus get into a clean state if there is a bug, or\r
214 to upgrade to a newer version of i3) you can use <tt>$mod+Shift+r</tt>.</p></div>\r
215 </div>\r
216 <div class="sect2">\r
217 <h3 id="_exiting_i3">2.10. Exiting i3</h3>\r
218 <div class="paragraph"><p>To cleanly exit i3 without killing your X server, you can use <tt>$mod+Shift+e</tt>.\r
219 By default, a dialog will ask you to confirm if you really want to quit.</p></div>\r
220 </div>\r
221 <div class="sect2">\r
222 <h3 id="_floating">2.11. Floating</h3>\r
223 <div class="paragraph"><p>Floating mode is the opposite of tiling mode. The position and size of\r
224 a window are not managed automatically by i3, but manually by\r
225 you. Using this mode violates the tiling paradigm but can be useful\r
226 for some corner cases like "Save as" dialog windows, or toolbar\r
227 windows (GIMP or similar). Those windows usually set the appropriate\r
228 hint and are opened in floating mode by default.</p></div>\r
229 <div class="paragraph"><p>You can toggle floating mode for a window by pressing <tt>$mod+Shift+Space</tt>. By\r
230 dragging the window’s titlebar with your mouse you can move the window\r
231 around. By grabbing the borders and moving them you can resize the window. You\r
232 can also do that by using the <a href="#floating_modifier">[floating_modifier]</a>. Another way to resize\r
233 floating windows using the mouse is to right-click on the titlebar and drag.</p></div>\r
234 <div class="paragraph"><p>For resizing floating windows with your keyboard, see the resizing binding mode\r
235 provided by the i3 <a href="https://github.com/i3/i3/blob/next/etc/config.keycodes">default config</a>.</p></div>\r
236 <div class="paragraph"><p>Floating windows are always on top of tiling windows.</p></div>\r
237 </div>\r
238 </div>\r
239 </div>\r
240 <div class="sect1">\r
241 <h2 id="_tree">3. Tree</h2>\r
242 <div class="sectionbody">\r
243 <div class="paragraph"><p>i3 stores all information about the X11 outputs, workspaces and layout of the\r
244 windows on them in a tree. The root node is the X11 root window, followed by\r
245 the X11 outputs, then dock areas and a content container, then workspaces and\r
246 finally the windows themselves. In previous versions of i3 we had multiple lists\r
247 (of outputs, workspaces) and a table for each workspace. That approach turned\r
248 out to be complicated to use (snapping), understand and implement.</p></div>\r
249 <div class="sect2">\r
250 <h3 id="_the_tree_consists_of_containers">3.1. The tree consists of Containers</h3>\r
251 <div class="paragraph"><p>The building blocks of our tree are so called <tt>Containers</tt>. A <tt>Container</tt> can\r
252 host a window (meaning an X11 window, one that you can actually see and use,\r
253 like a browser). Alternatively, it could contain one or more <tt>Containers</tt>. A\r
254 simple example is the workspace: When you start i3 with a single monitor, a\r
255 single workspace and you open two terminal windows, you will end up with a tree\r
256 like this:</p></div>\r
257 <div class="imageblock" style="float:right;">\r
258 <div class="content">\r
259 <img src="tree-layout2.png" alt="layout2" />\r
260 </div>\r
261 </div>\r
262 <div class="imageblock">\r
263 <div class="content">\r
264 <img src="tree-shot4.png" alt="shot4" />\r
265 </div>\r
266 <div class="title">Figure 1. Two terminals on standard workspace</div>\r
267 </div>\r
268 </div>\r
269 <div class="sect2">\r
270 <h3 id="OrientationSplit">3.2. Orientation and Split Containers</h3>\r
271 <div class="paragraph"><p>It is only natural to use so-called <tt>Split Containers</tt> in order to build a\r
272 layout when using a tree as data structure. In i3, every <tt>Container</tt> has an\r
273 orientation (horizontal, vertical or unspecified) and the orientation depends\r
274 on the layout the container is in (vertical for splitv and stacking, horizontal\r
275 for splith and tabbed). So, in our example with the workspace, the default\r
276 layout of the workspace <tt>Container</tt> is splith (most monitors are widescreen\r
277 nowadays). If you change the layout to splitv (<tt>$mod+v</tt> in the default config)\r
278 and <strong>then</strong> open two terminals, i3 will configure your windows like this:</p></div>\r
279 <div class="imageblock">\r
280 <div class="content">\r
281 <img src="tree-shot2.png" alt="shot2" />\r
282 </div>\r
283 <div class="title">Figure 2. Vertical Workspace Orientation</div>\r
284 </div>\r
285 <div class="paragraph"><p>An interesting new feature of i3 since version 4 is the ability to split anything:\r
286 Let’s assume you have two terminals on a workspace (with splith layout, that is\r
287 horizontal orientation), focus is on the right terminal. Now you want to open\r
288 another terminal window below the current one. If you would just open a new\r
289 terminal window, it would show up to the right due to the splith layout.\r
290 Instead, press <tt>$mod+v</tt> to split the container with the splitv layout (to\r
291 open a <tt>Horizontal Split Container</tt>, use <tt>$mod+h</tt>). Now you can open a new\r
292 terminal and it will open below the current one:</p></div>\r
293 <div class="imageblock" style="float:right;">\r
294 <div class="content">\r
295 <img src="tree-layout1.png" alt="Layout" />\r
296 </div>\r
297 </div>\r
298 <div class="imageblock">\r
299 <div class="content">\r
300 <img src="tree-shot1.png" alt="shot" />\r
301 </div>\r
302 <div class="title">Figure 3. Vertical Split Container</div>\r
303 </div>\r
304 <div style="clear:both;"></div>\r
305 <div class="paragraph"><p>You probably guessed it already: There is no limit on how deep your hierarchy\r
306 of splits can be.</p></div>\r
307 </div>\r
308 <div class="sect2">\r
309 <h3 id="_focus_parent">3.3. Focus parent</h3>\r
310 <div class="paragraph"><p>Let’s stay with our example from above. We have a terminal on the left and two\r
311 vertically split terminals on the right, focus is on the bottom right one. When\r
312 you open a new terminal, it will open below the current one.</p></div>\r
313 <div class="paragraph"><p>So, how can you open a new terminal window to the <strong>right</strong> of the current one?\r
314 The solution is to use <tt>focus parent</tt>, which will focus the <tt>Parent Container</tt> of\r
315 the current <tt>Container</tt>. In this case, you would focus the <tt>Vertical Split\r
316 Container</tt> which is <strong>inside</strong> the horizontally oriented workspace. Thus, now new\r
317 windows will be opened to the right of the <tt>Vertical Split Container</tt>:</p></div>\r
318 <div class="imageblock">\r
319 <div class="content">\r
320 <img src="tree-shot3.png" alt="shot3" />\r
321 </div>\r
322 <div class="title">Figure 4. Focus parent, then open new terminal</div>\r
323 </div>\r
324 </div>\r
325 <div class="sect2">\r
326 <h3 id="_implicit_containers">3.4. Implicit containers</h3>\r
327 <div class="paragraph"><p>In some cases, i3 needs to implicitly create a container to fulfill your\r
328 command.</p></div>\r
329 <div class="paragraph"><p>One example is the following scenario: You start i3 with a single monitor and a\r
330 single workspace on which you open three terminal windows. All these terminal\r
331 windows are directly attached to one node inside i3’s layout tree, the\r
332 workspace node. By default, the workspace node’s orientation is <tt>horizontal</tt>.</p></div>\r
333 <div class="paragraph"><p>Now you move one of these terminals down (<tt>$mod+Shift+k</tt> by default). The\r
334 workspace node’s orientation will be changed to <tt>vertical</tt>. The terminal window\r
335 you moved down is directly attached to the workspace and appears on the bottom\r
336 of the screen. A new (horizontal) container was created to accommodate the\r
337 other two terminal windows. You will notice this when switching to tabbed mode\r
338 (for example). You would end up having one tab with a representation of the split\r
339 container (e.g., "H[urxvt firefox]") and the other one being the terminal window\r
340 you moved down.</p></div>\r
341 </div>\r
342 </div>\r
343 </div>\r
344 <div class="sect1">\r
345 <h2 id="configuring">4. Configuring i3</h2>\r
346 <div class="sectionbody">\r
347 <div class="paragraph"><p>This is where the real fun begins ;-). Most things are very dependent on your\r
348 ideal working environment so we can’t make reasonable defaults for them.</p></div>\r
349 <div class="paragraph"><p>While not using a programming language for the configuration, i3 stays\r
350 quite flexible in regards to the things you usually want your window manager\r
351 to do.</p></div>\r
352 <div class="paragraph"><p>For example, you can configure bindings to jump to specific windows,\r
353 you can set specific applications to start on specific workspaces, you can\r
354 automatically start applications, you can change the colors of i3, and you\r
355 can bind your keys to do useful things.</p></div>\r
356 <div class="paragraph"><p>To change the configuration of i3, copy <tt>/etc/i3/config</tt> to <tt>~/.i3/config</tt>\r
357 (or <tt>~/.config/i3/config</tt> if you like the XDG directory scheme) and edit it\r
358 with a text editor.</p></div>\r
359 <div class="paragraph"><p>On first start (and on all following starts, unless you have a configuration\r
360 file), i3 will offer you to create a configuration file. You can tell the\r
361 wizard to use either Alt (<tt>Mod1</tt>) or Windows (<tt>Mod4</tt>) as modifier in the config\r
362 file. Also, the created config file will use the key symbols of your current\r
363 keyboard layout. To start the wizard, use the command <tt>i3-config-wizard</tt>.\r
364 Please note that you must not have <tt>~/.i3/config</tt>, otherwise the wizard will\r
365 exit.</p></div>\r
366 <div class="paragraph"><p>Since i3 4.0, a new configuration format is used. i3 will try to automatically\r
367 detect the format version of a config file based on a few different keywords,\r
368 but if you want to make sure that your config is read with the new format,\r
369 include the following line in your config file:</p></div>\r
370 <div class="listingblock">\r
371 <div class="content">\r
372 <pre><tt># i3 config file (v4)</tt></pre>\r
373 </div></div>\r
374 <div class="sect2">\r
375 <h3 id="_comments">4.1. Comments</h3>\r
376 <div class="paragraph"><p>It is possible and recommended to use comments in your configuration file to\r
377 properly document your setup for later reference. Comments are started with\r
378 a # and can only be used at the beginning of a line:</p></div>\r
379 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
380 <div class="listingblock">\r
381 <div class="content">\r
382 <pre><tt># This is a comment</tt></pre>\r
383 </div></div>\r
384 </div>\r
385 <div class="sect2">\r
386 <h3 id="fonts">4.2. Fonts</h3>\r
387 <div class="paragraph"><p>i3 has support for both X core fonts and FreeType fonts (through Pango) to\r
388 render window titles.</p></div>\r
389 <div class="paragraph"><p>To generate an X core font description, you can use <tt>xfontsel(1)</tt>. To see\r
390 special characters (Unicode), you need to use a font which supports the\r
391 ISO-10646 encoding.</p></div>\r
392 <div class="paragraph"><p>A FreeType font description is composed by a font family, a style, a weight,\r
393 a variant, a stretch and a size.\r
394 FreeType fonts support right-to-left rendering and contain often more\r
395 Unicode glyphs than X core fonts.</p></div>\r
396 <div class="paragraph"><p>If i3 cannot open the configured font, it will output an error in the logfile\r
397 and fall back to a working font.</p></div>\r
398 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
399 <div class="listingblock">\r
400 <div class="content">\r
401 <pre><tt>font &lt;X core font description&gt;\r
402 font pango:&lt;family list&gt; [&lt;style options&gt;] &lt;size&gt;</tt></pre>\r
403 </div></div>\r
404 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
405 <div class="listingblock">\r
406 <div class="content">\r
407 <pre><tt>font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1\r
408 font pango:DejaVu Sans Mono 10\r
409 font pango:DejaVu Sans Mono, Terminus Bold Semi-Condensed 11\r
410 font pango:Terminus 11px</tt></pre>\r
411 </div></div>\r
412 </div>\r
413 <div class="sect2">\r
414 <h3 id="keybindings">4.3. Keyboard bindings</h3>\r
415 <div class="paragraph"><p>A keyboard binding makes i3 execute a command (see below) upon pressing a\r
416 specific key. i3 allows you to bind either on keycodes or on keysyms (you can\r
417 also mix your bindings, though i3 will not protect you from overlapping ones).</p></div>\r
418 <div class="ulist"><ul>\r
419 <li>\r
420 <p>\r
421 A keysym (key symbol) is a description for a specific symbol, like "a"\r
422   or "b", but also more strange ones like "underscore" instead of "_". These\r
423   are the ones you use in Xmodmap to remap your keys. To get the current\r
424   mapping of your keys, use <tt>xmodmap -pke</tt>. To interactively enter a key and\r
425   see what keysym it is configured to, use <tt>xev</tt>.\r
426 </p>\r
427 </li>\r
428 <li>\r
429 <p>\r
430 Keycodes do not need to have a symbol assigned (handy for custom vendor\r
431   hotkeys on some notebooks) and they will not change their meaning as you\r
432   switch to a different keyboard layout (when using <tt>xmodmap</tt>).\r
433 </p>\r
434 </li>\r
435 </ul></div>\r
436 <div class="paragraph"><p>My recommendation is: If you often switch keyboard layouts but you want to keep\r
437 your bindings in the same physical location on the keyboard, use keycodes.\r
438 If you don’t switch layouts, and want a clean and simple config file, use\r
439 keysyms.</p></div>\r
440 <div class="paragraph"><p>Some tools (such as <tt>import</tt> or <tt>xdotool</tt>) might be unable to run upon a\r
441 KeyPress event, because the keyboard/pointer is still grabbed. For these\r
442 situations, the <tt>--release</tt> flag can be used, which will execute the command\r
443 after the keys have been released.</p></div>\r
444 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
445 <div class="listingblock">\r
446 <div class="content">\r
447 <pre><tt>bindsym [--release] [&lt;Group&gt;+][&lt;Modifiers&gt;+]&lt;keysym&gt; command\r
448 bindcode [--release] [&lt;Group&gt;+][&lt;Modifiers&gt;+]&lt;keycode&gt; command</tt></pre>\r
449 </div></div>\r
450 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
451 <div class="listingblock">\r
452 <div class="content">\r
453 <pre><tt># Fullscreen\r
454 bindsym $mod+f fullscreen toggle\r
455 \r
456 # Restart\r
457 bindsym $mod+Shift+r restart\r
458 \r
459 # Notebook-specific hotkeys\r
460 bindcode 214 exec --no-startup-id /home/michael/toggle_beamer.sh\r
461 \r
462 # Simulate ctrl+v upon pressing $mod+x\r
463 bindsym --release $mod+x exec --no-startup-id xdotool key --clearmodifiers ctrl+v\r
464 \r
465 # Take a screenshot upon pressing $mod+x (select an area)\r
466 bindsym --release $mod+x exec --no-startup-id import /tmp/latest-screenshot.png</tt></pre>\r
467 </div></div>\r
468 <div class="paragraph"><p>Available Modifiers:</p></div>\r
469 <div class="dlist"><dl>\r
470 <dt class="hdlist1">\r
471 Mod1-Mod5, Shift, Control\r
472 </dt>\r
473 <dd>\r
474 <p>\r
475 Standard modifiers, see <tt>xmodmap(1)</tt>\r
476 </p>\r
477 </dd>\r
478 <dt class="hdlist1">\r
479 Group1, Group2, Group3, Group4\r
480 </dt>\r
481 <dd>\r
482 <p>\r
483 When using multiple keyboard layouts (e.g. with <tt>setxkbmap -layout us,ru</tt>), you\r
484 can specify in which XKB group (also called “layout”) a keybinding should be\r
485 active. By default, keybindings are translated in Group1 and are active in all\r
486 groups. If you want to override keybindings in one of your layouts, specify the\r
487 corresponding group. For backwards compatibility, the group “Mode_switch” is an\r
488 alias for Group2.\r
489 </p>\r
490 </dd>\r
491 </dl></div>\r
492 </div>\r
493 <div class="sect2">\r
494 <h3 id="mousebindings">4.4. Mouse bindings</h3>\r
495 <div class="paragraph"><p>A mouse binding makes i3 execute a command upon pressing a specific mouse\r
496 button in the scope of the clicked container (see <a href="#command_criteria">[command_criteria]</a>). You\r
497 can configure mouse bindings in a similar way to key bindings.</p></div>\r
498 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
499 <div class="listingblock">\r
500 <div class="content">\r
501 <pre><tt>bindsym [--release] [--border] [--whole-window] [--exclude-titlebar] [&lt;Modifiers&gt;+]button&lt;n&gt; command</tt></pre>\r
502 </div></div>\r
503 <div class="paragraph"><p>By default, the binding will only run when you click on the titlebar of the\r
504 window. If the <tt>--release</tt> flag is given, it will run when the mouse button\r
505 is released.</p></div>\r
506 <div class="paragraph"><p>If the <tt>--whole-window</tt> flag is given, the binding will also run when any part\r
507 of the window is clicked, with the exception of the border. To have a bind run\r
508 when the border is clicked, specify the <tt>--border</tt> flag.</p></div>\r
509 <div class="paragraph"><p>If the <tt>--exclude-titlebar</tt> flag is given, the titlebar will not be considered\r
510 for the keybinding.</p></div>\r
511 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
512 <div class="listingblock">\r
513 <div class="content">\r
514 <pre><tt># The middle button over a titlebar kills the window\r
515 bindsym --release button2 kill\r
516 \r
517 # The middle button and a modifer over any part of the window kills the window\r
518 bindsym --whole-window $mod+button2 kill\r
519 \r
520 # The right button toggles floating\r
521 bindsym button3 floating toggle\r
522 bindsym $mod+button3 floating toggle\r
523 \r
524 # The side buttons move the window around\r
525 bindsym button9 move left\r
526 bindsym button8 move right</tt></pre>\r
527 </div></div>\r
528 </div>\r
529 <div class="sect2">\r
530 <h3 id="binding_modes">4.5. Binding modes</h3>\r
531 <div class="paragraph"><p>You can have multiple sets of bindings by using different binding modes. When\r
532 you switch to another binding mode, all bindings from the current mode are\r
533 released and only the bindings defined in the new mode are valid for as long as\r
534 you stay in that binding mode. The only predefined binding mode is <tt>default</tt>,\r
535 which is the mode i3 starts out with and to which all bindings not defined in a\r
536 specific binding mode belong.</p></div>\r
537 <div class="paragraph"><p>Working with binding modes consists of two parts: defining a binding mode and\r
538 switching to it. For these purposes, there are one config directive and one\r
539 command, both of which are called <tt>mode</tt>. The directive is used to define the\r
540 bindings belonging to a certain binding mode, while the command will switch to\r
541 the specified mode.</p></div>\r
542 <div class="paragraph"><p>It is recommended to use binding modes in combination with <a href="#variables">[variables]</a> in\r
543 order to make maintenance easier. Below is an example of how to use a binding\r
544 mode.</p></div>\r
545 <div class="paragraph"><p>Note that it is advisable to define bindings for switching back to the default\r
546 mode.</p></div>\r
547 <div class="paragraph"><p>Note that it is possible to use <a href="#pango_markup">[pango_markup]</a> for binding modes, but you\r
548 need to enable it explicitly by passing the <tt>--pango_markup</tt> flag to the mode\r
549 definition.</p></div>\r
550 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
551 <div class="listingblock">\r
552 <div class="content">\r
553 <pre><tt># config directive\r
554 mode [--pango_markup] &lt;name&gt;\r
555 \r
556 # command\r
557 mode &lt;name&gt;</tt></pre>\r
558 </div></div>\r
559 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
560 <div class="listingblock">\r
561 <div class="content">\r
562 <pre><tt># Press $mod+o followed by either f, t, Escape or Return to launch firefox,\r
563 # thunderbird or return to the default mode, respectively.\r
564 set $mode_launcher Launch: [f]irefox [t]hunderbird\r
565 bindsym $mod+o mode "$mode_launcher"\r
566 \r
567 mode "$mode_launcher" {\r
568     bindsym f exec firefox\r
569     bindsym t exec thunderbird\r
570 \r
571     bindsym Escape mode "default"\r
572     bindsym Return mode "default"\r
573 }</tt></pre>\r
574 </div></div>\r
575 </div>\r
576 <div class="sect2">\r
577 <h3 id="floating_modifier">4.6. The floating modifier</h3>\r
578 <div class="paragraph"><p>To move floating windows with your mouse, you can either grab their titlebar\r
579 or configure the so called floating modifier which you can then press and\r
580 click anywhere in the window itself to move it. The most common setup is to\r
581 use the same key you use for managing windows (Mod1 for example). Then\r
582 you can press Mod1, click into a window using your left mouse button, and drag\r
583 it to the position you want.</p></div>\r
584 <div class="paragraph"><p>When holding the floating modifier, you can resize a floating window by\r
585 pressing the right mouse button on it and moving around while holding it. If\r
586 you hold the shift button as well, the resize will be proportional (the aspect\r
587 ratio will be preserved).</p></div>\r
588 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
589 <div class="listingblock">\r
590 <div class="content">\r
591 <pre><tt>floating_modifier &lt;Modifier&gt;</tt></pre>\r
592 </div></div>\r
593 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
594 <div class="listingblock">\r
595 <div class="content">\r
596 <pre><tt>floating_modifier Mod1</tt></pre>\r
597 </div></div>\r
598 </div>\r
599 <div class="sect2">\r
600 <h3 id="_constraining_floating_window_size">4.7. Constraining floating window size</h3>\r
601 <div class="paragraph"><p>The maximum and minimum dimensions of floating windows can be specified. If\r
602 either dimension of <tt>floating_maximum_size</tt> is specified as -1, that dimension\r
603 will be unconstrained with respect to its maximum value. If either dimension of\r
604 <tt>floating_maximum_size</tt> is undefined, or specified as 0, i3 will use a default\r
605 value to constrain the maximum size. <tt>floating_minimum_size</tt> is treated in a\r
606 manner analogous to <tt>floating_maximum_size</tt>.</p></div>\r
607 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
608 <div class="listingblock">\r
609 <div class="content">\r
610 <pre><tt>floating_minimum_size &lt;width&gt; x &lt;height&gt;\r
611 floating_maximum_size &lt;width&gt; x &lt;height&gt;</tt></pre>\r
612 </div></div>\r
613 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
614 <div class="listingblock">\r
615 <div class="content">\r
616 <pre><tt>floating_minimum_size 75 x 50\r
617 floating_maximum_size -1 x -1</tt></pre>\r
618 </div></div>\r
619 </div>\r
620 <div class="sect2">\r
621 <h3 id="_orientation_for_new_workspaces">4.8. Orientation for new workspaces</h3>\r
622 <div class="paragraph"><p>New workspaces get a reasonable default orientation: Wide-screen monitors\r
623 (anything wider than high) get horizontal orientation, rotated monitors\r
624 (anything higher than wide) get vertical orientation.</p></div>\r
625 <div class="paragraph"><p>With the <tt>default_orientation</tt> configuration directive, you can override that\r
626 behavior.</p></div>\r
627 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
628 <div class="listingblock">\r
629 <div class="content">\r
630 <pre><tt>default_orientation horizontal|vertical|auto</tt></pre>\r
631 </div></div>\r
632 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
633 <div class="listingblock">\r
634 <div class="content">\r
635 <pre><tt>default_orientation vertical</tt></pre>\r
636 </div></div>\r
637 </div>\r
638 <div class="sect2">\r
639 <h3 id="_layout_mode_for_new_containers">4.9. Layout mode for new containers</h3>\r
640 <div class="paragraph"><p>This option determines in which mode new containers on workspace level will\r
641 start.</p></div>\r
642 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
643 <div class="listingblock">\r
644 <div class="content">\r
645 <pre><tt>workspace_layout default|stacking|tabbed</tt></pre>\r
646 </div></div>\r
647 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
648 <div class="listingblock">\r
649 <div class="content">\r
650 <pre><tt>workspace_layout tabbed</tt></pre>\r
651 </div></div>\r
652 </div>\r
653 <div class="sect2">\r
654 <h3 id="_border_style_for_new_windows">4.10. Border style for new windows</h3>\r
655 <div class="paragraph"><p>This option determines which border style new windows will have. The default is\r
656 <tt>normal</tt>. Note that new_float applies only to windows which are starting out as\r
657 floating windows, e.g., dialog windows, but not windows that are floated later on.</p></div>\r
658 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
659 <div class="listingblock">\r
660 <div class="content">\r
661 <pre><tt>new_window normal|none|pixel\r
662 new_window normal|pixel &lt;px&gt;\r
663 new_float normal|none|pixel\r
664 new_float normal|pixel &lt;px&gt;</tt></pre>\r
665 </div></div>\r
666 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
667 <div class="listingblock">\r
668 <div class="content">\r
669 <pre><tt>new_window pixel</tt></pre>\r
670 </div></div>\r
671 <div class="paragraph"><p>The "normal" and "pixel" border styles support an optional border width in\r
672 pixels:</p></div>\r
673 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
674 <div class="listingblock">\r
675 <div class="content">\r
676 <pre><tt># The same as new_window none\r
677 new_window pixel 0\r
678 \r
679 # A 3 px border\r
680 new_window pixel 3</tt></pre>\r
681 </div></div>\r
682 </div>\r
683 <div class="sect2">\r
684 <h3 id="_hiding_vertical_borders">4.11. Hiding borders adjacent to the screen edges</h3>\r
685 <div class="paragraph"><p>You can hide container borders adjacent to the screen edges using\r
686 <tt>hide_edge_borders</tt>. This is useful if you are using scrollbars, or do not want\r
687 to waste even two pixels in displayspace. The "smart" setting hides borders on\r
688 workspaces with only one window visible, but keeps them on workspaces with\r
689 multiple windows visible. Default is none.</p></div>\r
690 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
691 <div class="listingblock">\r
692 <div class="content">\r
693 <pre><tt>hide_edge_borders none|vertical|horizontal|both|smart</tt></pre>\r
694 </div></div>\r
695 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
696 <div class="listingblock">\r
697 <div class="content">\r
698 <pre><tt>hide_edge_borders vertical</tt></pre>\r
699 </div></div>\r
700 </div>\r
701 <div class="sect2">\r
702 <h3 id="for_window">4.12. Arbitrary commands for specific windows (for_window)</h3>\r
703 <div class="paragraph"><p>With the <tt>for_window</tt> command, you can let i3 execute any command when it\r
704 encounters a specific window. This can be used to set windows to floating or to\r
705 change their border style, for example.</p></div>\r
706 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
707 <div class="listingblock">\r
708 <div class="content">\r
709 <pre><tt>for_window &lt;criteria&gt; &lt;command&gt;</tt></pre>\r
710 </div></div>\r
711 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
712 <div class="listingblock">\r
713 <div class="content">\r
714 <pre><tt># enable floating mode for all XTerm windows\r
715 for_window [class="XTerm"] floating enable\r
716 \r
717 # Make all urxvts use a 1-pixel border:\r
718 for_window [class="urxvt"] border pixel 1\r
719 \r
720 # A less useful, but rather funny example:\r
721 # makes the window floating as soon as I change\r
722 # directory to ~/work\r
723 for_window [title="x200: ~/work"] floating enable</tt></pre>\r
724 </div></div>\r
725 <div class="paragraph"><p>The valid criteria are the same as those for commands, see <a href="#command_criteria">[command_criteria]</a>.</p></div>\r
726 </div>\r
727 <div class="sect2">\r
728 <h3 id="no_focus">4.13. Don&#8217;t focus window upon opening</h3>\r
729 <div class="paragraph"><p>When a new window appears, it will be focused. The <tt>no_focus</tt> directive allows preventing\r
730 this from happening and must be used in combination with <a href="#command_criteria">[command_criteria]</a>.</p></div>\r
731 <div class="paragraph"><p>Note that this does not apply to all cases, e.g., when feeding data into a running application\r
732 causing it to request being focused. To configure the behavior in such cases, refer to\r
733 <a href="#focus_on_window_activation">[focus_on_window_activation]</a>.</p></div>\r
734 <div class="paragraph"><p><tt>no_focus</tt> will also be ignored for the first window on a workspace as there shouldn&#8217;t be\r
735 a reason to not focus the window in this case. This allows for better usability in\r
736 combination with <tt>workspace_layout</tt>.</p></div>\r
737 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
738 <div class="listingblock">\r
739 <div class="content">\r
740 <pre><tt>no_focus &lt;criteria&gt;</tt></pre>\r
741 </div></div>\r
742 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
743 <div class="listingblock">\r
744 <div class="content">\r
745 <pre><tt>no_focus [window_role="pop-up"]</tt></pre>\r
746 </div></div>\r
747 </div>\r
748 <div class="sect2">\r
749 <h3 id="variables">4.14. Variables</h3>\r
750 <div class="paragraph"><p>As you learned in the section about keyboard bindings, you will have\r
751 to configure lots of bindings containing modifier keys. If you want to save\r
752 yourself some typing and be able to change the modifier you use later,\r
753 variables can be handy.</p></div>\r
754 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
755 <div class="listingblock">\r
756 <div class="content">\r
757 <pre><tt>set $&lt;name&gt; &lt;value&gt;</tt></pre>\r
758 </div></div>\r
759 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
760 <div class="listingblock">\r
761 <div class="content">\r
762 <pre><tt>set $m Mod1\r
763 bindsym $m+Shift+r restart</tt></pre>\r
764 </div></div>\r
765 <div class="paragraph"><p>Variables are directly replaced in the file when parsing. Variables expansion\r
766 is not recursive so it is not possible to define a variable with a value\r
767 containing another variable. There is no fancy handling and there are\r
768 absolutely no plans to change this. If you need a more dynamic configuration\r
769 you should create a little script which generates a configuration file and run\r
770 it before starting i3 (for example in your <tt>~/.xsession</tt> file).</p></div>\r
771 <div class="paragraph"><p>Also see <a href="#xresources">[xresources]</a> to learn how to create variables based on resources\r
772 loaded from the X resource database.</p></div>\r
773 </div>\r
774 <div class="sect2">\r
775 <h3 id="xresources">4.15. X resources</h3>\r
776 <div class="paragraph"><p><a href="#variables">[variables]</a> can also be created using a value configured in the X resource\r
777 database. This is useful, for example, to avoid configuring color values within\r
778 the i3 configuration. Instead, the values can be configured, once, in the X\r
779 resource database to achieve an easily maintainable, consistent color theme\r
780 across many X applications.</p></div>\r
781 <div class="paragraph"><p>Defining a resource will load this resource from the resource database and\r
782 assign its value to the specified variable. A fallback must be specified in\r
783 case the resource cannot be loaded from the database.</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>set_from_resource $&lt;name&gt; &lt;resource_name&gt; &lt;fallback&gt;</tt></pre>\r
788 </div></div>\r
789 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
790 <div class="listingblock">\r
791 <div class="content">\r
792 <pre><tt># The ~/.Xresources should contain a line such as\r
793 #     *color0: #121212\r
794 # and must be loaded properly, e.g., by using\r
795 #     xrdb ~/.Xresources\r
796 # This value is picked up on by other applications (e.g., the URxvt terminal\r
797 # emulator) and can be used in i3 like this:\r
798 set_from_resource $black i3wm.color0 #000000</tt></pre>\r
799 </div></div>\r
800 </div>\r
801 <div class="sect2">\r
802 <h3 id="assign_workspace">4.16. Automatically putting clients on specific workspaces</h3>\r
803 <div class="paragraph"><p>To automatically make a specific window show up on a specific workspace, you\r
804 can use an <strong>assignment</strong>. You can match windows by using any criteria,\r
805 see <a href="#command_criteria">[command_criteria]</a>. It is recommended that you match on window classes\r
806 (and instances, when appropriate) instead of window titles whenever possible\r
807 because some applications first create their window, and then worry about\r
808 setting the correct title. Firefox with Vimperator comes to mind. The window\r
809 starts up being named Firefox, and only when Vimperator is loaded does the\r
810 title change. As i3 will get the title as soon as the application maps the\r
811 window (mapping means actually displaying it on the screen), you’d need to have\r
812 to match on <em>Firefox</em> in this case.</p></div>\r
813 <div class="paragraph"><p>Assignments are processed by i3 in the order in which they appear in the config\r
814 file. The first one which matches the window wins and later assignments are not\r
815 considered.</p></div>\r
816 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
817 <div class="listingblock">\r
818 <div class="content">\r
819 <pre><tt>assign &lt;criteria&gt; [→] [workspace] &lt;workspace&gt;</tt></pre>\r
820 </div></div>\r
821 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
822 <div class="listingblock">\r
823 <div class="content">\r
824 <pre><tt># Assign URxvt terminals to workspace 2\r
825 assign [class="URxvt"] 2\r
826 \r
827 # Same thing, but more precise (exact match instead of substring)\r
828 assign [class="^URxvt$"] 2\r
829 \r
830 # Same thing, but with a beautiful arrow :)\r
831 assign [class="^URxvt$"] → 2\r
832 \r
833 # Assignment to a named workspace\r
834 assign [class="^URxvt$"] → work\r
835 \r
836 # Start urxvt -name irssi\r
837 assign [class="^URxvt$" instance="^irssi$"] → 3</tt></pre>\r
838 </div></div>\r
839 <div class="paragraph"><p>Note that the arrow is not required, it just looks good :-). If you decide to\r
840 use it, it has to be a UTF-8 encoded arrow, not <tt>-&gt;</tt> or something like that.</p></div>\r
841 <div class="paragraph"><p>To get the class and instance, you can use <tt>xprop</tt>. After clicking on the\r
842 window, you will see the following output:</p></div>\r
843 <div class="paragraph"><p><strong>xprop</strong>:</p></div>\r
844 <div class="listingblock">\r
845 <div class="content">\r
846 <pre><tt>WM_CLASS(STRING) = "irssi", "URxvt"</tt></pre>\r
847 </div></div>\r
848 <div class="paragraph"><p>The first part of the WM_CLASS is the instance ("irssi" in this example), the\r
849 second part is the class ("URxvt" in this example).</p></div>\r
850 <div class="paragraph"><p>Should you have any problems with assignments, make sure to check the i3\r
851 logfile first (see <a href="http://i3wm.org/docs/debugging.html">http://i3wm.org/docs/debugging.html</a>). It includes more\r
852 details about the matching process and the window’s actual class, instance and\r
853 title when starting up.</p></div>\r
854 <div class="paragraph"><p>Note that if you want to start an application just once on a specific\r
855 workspace, but you don’t want to assign all instances of it permanently, you\r
856 can make use of i3’s startup-notification support (see <a href="#exec">[exec]</a>) in your config\r
857 file in the following way:</p></div>\r
858 <div class="paragraph"><p><strong>Start iceweasel on workspace 3 (once)</strong>:</p></div>\r
859 <div class="listingblock">\r
860 <div class="content">\r
861 <pre><tt># Start iceweasel on workspace 3, then switch back to workspace 1\r
862 # (Being a command-line utility, i3-msg does not support startup notifications,\r
863 #  hence the exec --no-startup-id.)\r
864 # (Starting iceweasel with i3’s exec command is important in order to make i3\r
865 #  create a startup notification context, without which the iceweasel window(s)\r
866 #  cannot be matched onto the workspace on which the command was started.)\r
867 exec --no-startup-id i3-msg 'workspace 3; exec iceweasel; workspace 1'</tt></pre>\r
868 </div></div>\r
869 </div>\r
870 <div class="sect2">\r
871 <h3 id="_automatically_starting_applications_on_i3_startup">4.17. Automatically starting applications on i3 startup</h3>\r
872 <div class="paragraph"><p>By using the <tt>exec</tt> keyword outside a keybinding, you can configure\r
873 which commands will be performed by i3 on initial startup. <tt>exec</tt>\r
874 commands will not run when restarting i3, if you need a command to run\r
875 also when restarting i3 you should use the <tt>exec_always</tt>\r
876 keyword. These commands will be run in order.</p></div>\r
877 <div class="paragraph"><p>See <a href="#command_chaining">[command_chaining]</a> for details on the special meaning of <tt>;</tt> (semicolon)\r
878 and <tt>,</tt> (comma): they chain commands together in i3, so you need to use quoted\r
879 strings (as shown in <a href="#exec_quoting">[exec_quoting]</a>) if they appear in your command.</p></div>\r
880 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
881 <div class="listingblock">\r
882 <div class="content">\r
883 <pre><tt>exec [--no-startup-id] &lt;command&gt;\r
884 exec_always [--no-startup-id] &lt;command&gt;</tt></pre>\r
885 </div></div>\r
886 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
887 <div class="listingblock">\r
888 <div class="content">\r
889 <pre><tt>exec chromium\r
890 exec_always ~/my_script.sh\r
891 \r
892 # Execute the terminal emulator urxvt, which is not yet startup-notification aware.\r
893 exec --no-startup-id urxvt</tt></pre>\r
894 </div></div>\r
895 <div class="paragraph"><p>The flag --no-startup-id is explained in <a href="#exec">[exec]</a>.</p></div>\r
896 </div>\r
897 <div class="sect2">\r
898 <h3 id="workspace_screen">4.18. Automatically putting workspaces on specific screens</h3>\r
899 <div class="paragraph"><p>If you assign clients to workspaces, it might be handy to put the\r
900 workspaces on specific screens. Also, the assignment of workspaces to screens\r
901 will determine which workspace i3 uses for a new screen when adding screens\r
902 or when starting (e.g., by default it will use 1 for the first screen, 2 for\r
903 the second screen and so on).</p></div>\r
904 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
905 <div class="listingblock">\r
906 <div class="content">\r
907 <pre><tt>workspace &lt;workspace&gt; output &lt;output&gt;</tt></pre>\r
908 </div></div>\r
909 <div class="paragraph"><p>The <em>output</em> is the name of the RandR output you attach your screen to. On a\r
910 laptop, you might have VGA1 and LVDS1 as output names. You can see the\r
911 available outputs by running <tt>xrandr --current</tt>.</p></div>\r
912 <div class="paragraph"><p>If you use named workspaces, they must be quoted:</p></div>\r
913 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
914 <div class="listingblock">\r
915 <div class="content">\r
916 <pre><tt>workspace 1 output LVDS1\r
917 workspace 5 output VGA1\r
918 workspace "2: vim" output VGA1</tt></pre>\r
919 </div></div>\r
920 </div>\r
921 <div class="sect2">\r
922 <h3 id="_changing_colors">4.19. Changing colors</h3>\r
923 <div class="paragraph"><p>You can change all colors which i3 uses to draw the window decorations.</p></div>\r
924 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
925 <div class="listingblock">\r
926 <div class="content">\r
927 <pre><tt>&lt;colorclass&gt; &lt;border&gt; &lt;background&gt; &lt;text&gt; &lt;indicator&gt; &lt;child_border&gt;</tt></pre>\r
928 </div></div>\r
929 <div class="paragraph"><p>Where colorclass can be one of:</p></div>\r
930 <div class="dlist"><dl>\r
931 <dt class="hdlist1">\r
932 client.focused\r
933 </dt>\r
934 <dd>\r
935 <p>\r
936         A client which currently has the focus.\r
937 </p>\r
938 </dd>\r
939 <dt class="hdlist1">\r
940 client.focused_inactive\r
941 </dt>\r
942 <dd>\r
943 <p>\r
944         A client which is the focused one of its container, but it does not have\r
945         the focus at the moment.\r
946 </p>\r
947 </dd>\r
948 <dt class="hdlist1">\r
949 client.unfocused\r
950 </dt>\r
951 <dd>\r
952 <p>\r
953         A client which is not the focused one of its container.\r
954 </p>\r
955 </dd>\r
956 <dt class="hdlist1">\r
957 client.urgent\r
958 </dt>\r
959 <dd>\r
960 <p>\r
961         A client which has its urgency hint activated.\r
962 </p>\r
963 </dd>\r
964 <dt class="hdlist1">\r
965 client.placeholder\r
966 </dt>\r
967 <dd>\r
968 <p>\r
969         Background and text color are used to draw placeholder window contents\r
970         (when restoring layouts). Border and indicator are ignored.\r
971 </p>\r
972 </dd>\r
973 <dt class="hdlist1">\r
974 client.background\r
975 </dt>\r
976 <dd>\r
977 <p>\r
978         Background color which will be used to paint the background of the\r
979         client window on top of which the client will be rendered. Only clients\r
980         which do not cover the whole area of this window expose the color. Note\r
981         that this colorclass only takes a single color.\r
982 </p>\r
983 </dd>\r
984 </dl></div>\r
985 <div class="paragraph"><p>Colors are in HTML hex format (#rrggbb), see the following example:</p></div>\r
986 <div class="paragraph"><p><strong>Examples (default colors)</strong>:</p></div>\r
987 <div class="listingblock">\r
988 <div class="content">\r
989 <pre><tt># class                 border  backgr. text    indicator child_border\r
990 client.focused          #4c7899 #285577 #ffffff #2e9ef4   #285577\r
991 client.focused_inactive #333333 #5f676a #ffffff #484e50   #5f676a\r
992 client.unfocused        #333333 #222222 #888888 #292d2e   #222222\r
993 client.urgent           #2f343a #900000 #ffffff #900000   #900000\r
994 client.placeholder      #000000 #0c0c0c #ffffff #000000   #0c0c0c\r
995 \r
996 client.background       #ffffff</tt></pre>\r
997 </div></div>\r
998 <div class="paragraph"><p>Note that for the window decorations, the color around the child window is the\r
999 "child_border", and "border" color is only the two thin lines around the\r
1000 titlebar.</p></div>\r
1001 <div class="paragraph"><p>The indicator color is used for indicating where a new window will be opened.\r
1002 For horizontal split containers, the right border will be painted in indicator\r
1003 color, for vertical split containers, the bottom border. This only applies to\r
1004 single windows within a split container, which are otherwise indistinguishable\r
1005 from single windows outside of a split container.</p></div>\r
1006 </div>\r
1007 <div class="sect2">\r
1008 <h3 id="_interprocess_communication">4.20. Interprocess communication</h3>\r
1009 <div class="paragraph"><p>i3 uses Unix sockets to provide an IPC interface. This allows third-party\r
1010 programs to get information from i3, such as the current workspaces\r
1011 (to display a workspace bar), and to control i3.</p></div>\r
1012 <div class="paragraph"><p>The IPC socket is enabled by default and will be created in\r
1013 <tt>/tmp/i3-%u.XXXXXX/ipc-socket.%p</tt> where <tt>%u</tt> is your UNIX username, <tt>%p</tt> is\r
1014 the PID of i3 and XXXXXX is a string of random characters from the portable\r
1015 filename character set (see mkdtemp(3)).</p></div>\r
1016 <div class="paragraph"><p>You can override the default path through the environment-variable <tt>I3SOCK</tt> or\r
1017 by specifying the <tt>ipc-socket</tt> directive. This is discouraged, though, since i3\r
1018 does the right thing by default. If you decide to change it, it is strongly\r
1019 recommended to set this to a location in your home directory so that no other\r
1020 user can create that directory.</p></div>\r
1021 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
1022 <div class="listingblock">\r
1023 <div class="content">\r
1024 <pre><tt>ipc-socket ~/.i3/i3-ipc.sock</tt></pre>\r
1025 </div></div>\r
1026 <div class="paragraph"><p>You can then use the <tt>i3-msg</tt> application to perform any command listed in\r
1027 the next section.</p></div>\r
1028 </div>\r
1029 <div class="sect2">\r
1030 <h3 id="_focus_follows_mouse">4.21. Focus follows mouse</h3>\r
1031 <div class="paragraph"><p>By default, window focus follows your mouse movements as the mouse crosses\r
1032 window borders. However, if you have a setup where your mouse usually is in your\r
1033 way (like a touchpad on your laptop which you do not want to disable\r
1034 completely), you might want to disable <em>focus follows mouse</em> and control focus\r
1035 only by using your keyboard.  The mouse will still be useful inside the\r
1036 currently active window (for example to click on links in your browser window).</p></div>\r
1037 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1038 <div class="listingblock">\r
1039 <div class="content">\r
1040 <pre><tt>focus_follows_mouse yes|no</tt></pre>\r
1041 </div></div>\r
1042 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1043 <div class="listingblock">\r
1044 <div class="content">\r
1045 <pre><tt>focus_follows_mouse no</tt></pre>\r
1046 </div></div>\r
1047 </div>\r
1048 <div class="sect2">\r
1049 <h3 id="_mouse_warping">4.22. Mouse warping</h3>\r
1050 <div class="paragraph"><p>By default, when switching focus to a window on a different output (e.g.\r
1051 focusing a window on workspace 3 on output VGA-1, coming from workspace 2 on\r
1052 LVDS-1), the mouse cursor is warped to the center of that window.</p></div>\r
1053 <div class="paragraph"><p>With the <tt>mouse_warping</tt> option, you can control when the mouse cursor should\r
1054 be warped. <tt>none</tt> disables warping entirely, whereas <tt>output</tt> is the default\r
1055 behavior described above.</p></div>\r
1056 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1057 <div class="listingblock">\r
1058 <div class="content">\r
1059 <pre><tt>mouse_warping output|none</tt></pre>\r
1060 </div></div>\r
1061 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1062 <div class="listingblock">\r
1063 <div class="content">\r
1064 <pre><tt>mouse_warping none</tt></pre>\r
1065 </div></div>\r
1066 </div>\r
1067 <div class="sect2">\r
1068 <h3 id="_popups_during_fullscreen_mode">4.23. Popups during fullscreen mode</h3>\r
1069 <div class="paragraph"><p>When you are in fullscreen mode, some applications still open popup windows\r
1070 (take Xpdf for example). This is because these applications may not be aware\r
1071 that they are in fullscreen mode (they do not check the corresponding hint).\r
1072 There are three things which are possible to do in this situation:</p></div>\r
1073 <div class="olist arabic"><ol class="arabic">\r
1074 <li>\r
1075 <p>\r
1076 Display the popup if it belongs to the fullscreen application only. This is\r
1077    the default and should be reasonable behavior for most users.\r
1078 </p>\r
1079 </li>\r
1080 <li>\r
1081 <p>\r
1082 Just ignore the popup (don’t map it). This won’t interrupt you while you are\r
1083    in fullscreen. However, some apps might react badly to this (deadlock until\r
1084    you go out of fullscreen).\r
1085 </p>\r
1086 </li>\r
1087 <li>\r
1088 <p>\r
1089 Leave fullscreen mode.\r
1090 </p>\r
1091 </li>\r
1092 </ol></div>\r
1093 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1094 <div class="listingblock">\r
1095 <div class="content">\r
1096 <pre><tt>popup_during_fullscreen smart|ignore|leave_fullscreen</tt></pre>\r
1097 </div></div>\r
1098 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1099 <div class="listingblock">\r
1100 <div class="content">\r
1101 <pre><tt>popup_during_fullscreen smart</tt></pre>\r
1102 </div></div>\r
1103 </div>\r
1104 <div class="sect2">\r
1105 <h3 id="_focus_wrapping">4.24. Focus wrapping</h3>\r
1106 <div class="paragraph"><p>When being in a tabbed or stacked container, the first container will be\r
1107 focused when you use <tt>focus down</tt> on the last container&#8201;&#8212;&#8201;the focus wraps. If\r
1108 however there is another stacked/tabbed container in that direction, focus will\r
1109 be set on that container. This is the default behavior so you can navigate to\r
1110 all your windows without having to use <tt>focus parent</tt>.</p></div>\r
1111 <div class="paragraph"><p>If you want the focus to <strong>always</strong> wrap and you are aware of using <tt>focus\r
1112 parent</tt> to switch to different containers, you can use the\r
1113 <tt>force_focus_wrapping</tt> configuration directive. After enabling it, the focus\r
1114 will always wrap.</p></div>\r
1115 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1116 <div class="listingblock">\r
1117 <div class="content">\r
1118 <pre><tt>force_focus_wrapping yes|no</tt></pre>\r
1119 </div></div>\r
1120 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1121 <div class="listingblock">\r
1122 <div class="content">\r
1123 <pre><tt>force_focus_wrapping yes</tt></pre>\r
1124 </div></div>\r
1125 </div>\r
1126 <div class="sect2">\r
1127 <h3 id="_forcing_xinerama">4.25. Forcing Xinerama</h3>\r
1128 <div class="paragraph"><p>As explained in-depth in <a href="http://i3wm.org/docs/multi-monitor.html">http://i3wm.org/docs/multi-monitor.html</a>, some X11\r
1129 video drivers (especially the nVidia binary driver) only provide support for\r
1130 Xinerama instead of RandR. In such a situation, i3 must be told to use the\r
1131 inferior Xinerama API explicitly and therefore don’t provide support for\r
1132 reconfiguring your screens on the fly (they are read only once on startup and\r
1133 that’s it).</p></div>\r
1134 <div class="paragraph"><p>For people who cannot modify their <tt>~/.xsession</tt> to add the\r
1135 <tt>--force-xinerama</tt> commandline parameter, a configuration option is provided:</p></div>\r
1136 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1137 <div class="listingblock">\r
1138 <div class="content">\r
1139 <pre><tt>force_xinerama yes|no</tt></pre>\r
1140 </div></div>\r
1141 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1142 <div class="listingblock">\r
1143 <div class="content">\r
1144 <pre><tt>force_xinerama yes</tt></pre>\r
1145 </div></div>\r
1146 <div class="paragraph"><p>Also note that your output names are not descriptive (like <tt>HDMI1</tt>) when using\r
1147 Xinerama, instead they are counted up, starting at 0: <tt>xinerama-0</tt>, <tt>xinerama-1</tt>, …</p></div>\r
1148 </div>\r
1149 <div class="sect2">\r
1150 <h3 id="_automatic_back_and_forth_when_switching_to_the_current_workspace">4.26. Automatic back-and-forth when switching to the current workspace</h3>\r
1151 <div class="paragraph"><p>This configuration directive enables automatic <tt>workspace back_and_forth</tt> (see\r
1152 <a href="#back_and_forth">[back_and_forth]</a>) when switching to the workspace that is currently focused.</p></div>\r
1153 <div class="paragraph"><p>For instance: Assume you are on workspace "1: www" and switch to "2: IM" using\r
1154 mod+2 because somebody sent you a message. You don’t need to remember where you\r
1155 came from now, you can just press $mod+2 again to switch back to "1: www".</p></div>\r
1156 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1157 <div class="listingblock">\r
1158 <div class="content">\r
1159 <pre><tt>workspace_auto_back_and_forth yes|no</tt></pre>\r
1160 </div></div>\r
1161 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1162 <div class="listingblock">\r
1163 <div class="content">\r
1164 <pre><tt>workspace_auto_back_and_forth yes</tt></pre>\r
1165 </div></div>\r
1166 </div>\r
1167 <div class="sect2">\r
1168 <h3 id="_delaying_urgency_hint_reset_on_workspace_change">4.27. Delaying urgency hint reset on workspace change</h3>\r
1169 <div class="paragraph"><p>If an application on another workspace sets an urgency hint, switching to this\r
1170 workspace may lead to immediate focus of the application, which also means the\r
1171 window decoration color would be immediately reset to <tt>client.focused</tt>. This\r
1172 may make it unnecessarily hard to tell which window originally raised the\r
1173 event.</p></div>\r
1174 <div class="paragraph"><p>In order to prevent this, you can tell i3 to delay resetting the urgency state\r
1175 by a certain time using the <tt>force_display_urgency_hint</tt> directive. Setting the\r
1176 value to 0 disables this feature.</p></div>\r
1177 <div class="paragraph"><p>The default is 500ms.</p></div>\r
1178 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1179 <div class="listingblock">\r
1180 <div class="content">\r
1181 <pre><tt>force_display_urgency_hint &lt;timeout&gt; ms</tt></pre>\r
1182 </div></div>\r
1183 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1184 <div class="listingblock">\r
1185 <div class="content">\r
1186 <pre><tt>force_display_urgency_hint 500 ms</tt></pre>\r
1187 </div></div>\r
1188 </div>\r
1189 <div class="sect2">\r
1190 <h3 id="focus_on_window_activation">4.28. Focus on window activation</h3>\r
1191 <div class="paragraph"><p>If a window is activated, e.g., via <tt>google-chrome www.google.com</tt>, it may request\r
1192 to take focus. Since this may not preferable, different reactions can be configured.</p></div>\r
1193 <div class="paragraph"><p>Note that this may not affect windows that are being opened. To prevent new windows\r
1194 from being focused, see <a href="#no_focus">[no_focus]</a>.</p></div>\r
1195 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1196 <div class="listingblock">\r
1197 <div class="content">\r
1198 <pre><tt>focus_on_window_activation smart|urgent|focus|none</tt></pre>\r
1199 </div></div>\r
1200 <div class="paragraph"><p>The different modes will act as follows:</p></div>\r
1201 <div class="dlist"><dl>\r
1202 <dt class="hdlist1">\r
1203 smart\r
1204 </dt>\r
1205 <dd>\r
1206 <p>\r
1207     This is the default behavior. If the window requesting focus is on an active\r
1208     workspace, it will receive the focus. Otherwise, the urgency hint will be set.\r
1209 </p>\r
1210 </dd>\r
1211 <dt class="hdlist1">\r
1212 urgent\r
1213 </dt>\r
1214 <dd>\r
1215 <p>\r
1216     The window will always be marked urgent, but the focus will not be stolen.\r
1217 </p>\r
1218 </dd>\r
1219 <dt class="hdlist1">\r
1220 focus\r
1221 </dt>\r
1222 <dd>\r
1223 <p>\r
1224     The window will always be focused and not be marked urgent.\r
1225 </p>\r
1226 </dd>\r
1227 <dt class="hdlist1">\r
1228 none\r
1229 </dt>\r
1230 <dd>\r
1231 <p>\r
1232     The window will neither be focused, nor be marked urgent.\r
1233 </p>\r
1234 </dd>\r
1235 </dl></div>\r
1236 </div>\r
1237 <div class="sect2">\r
1238 <h3 id="show_marks">4.29. Drawing marks on window decoration</h3>\r
1239 <div class="paragraph"><p>If activated, marks (see <a href="#vim_like_marks">[vim_like_marks]</a>) on windows are drawn in their window\r
1240 decoration. However, any mark starting with an underscore in its name (<tt>_</tt>) will\r
1241 not be drawn even if this option is activated.</p></div>\r
1242 <div class="paragraph"><p>The default for this option is <tt>yes</tt>.</p></div>\r
1243 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1244 <div class="listingblock">\r
1245 <div class="content">\r
1246 <pre><tt>show_marks yes|no</tt></pre>\r
1247 </div></div>\r
1248 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1249 <div class="listingblock">\r
1250 <div class="content">\r
1251 <pre><tt>show_marks yes</tt></pre>\r
1252 </div></div>\r
1253 </div>\r
1254 <div class="sect2">\r
1255 <h3 id="line_continuation">4.30. Line continuation</h3>\r
1256 <div class="paragraph"><p>Config files support line continuation, meaning when you end a line in a\r
1257 backslash character (<tt>\</tt>), the line-break will be ignored by the parser. This\r
1258 feature can be used to create more readable configuration files.\r
1259 Commented lines are not continued.</p></div>\r
1260 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
1261 <div class="listingblock">\r
1262 <div class="content">\r
1263 <pre><tt>bindsym Mod1+f \\r
1264 fullscreen toggle\r
1265 \r
1266 # this line is not continued \\r
1267 bindsym Mod1+F fullscreen toggle</tt></pre>\r
1268 </div></div>\r
1269 </div>\r
1270 </div>\r
1271 </div>\r
1272 <div class="sect1">\r
1273 <h2 id="_configuring_i3bar">5. Configuring i3bar</h2>\r
1274 <div class="sectionbody">\r
1275 <div class="paragraph"><p>The bar at the bottom of your monitor is drawn by a separate process called\r
1276 i3bar. Having this part of "the i3 user interface" in a separate process has\r
1277 several advantages:</p></div>\r
1278 <div class="olist arabic"><ol class="arabic">\r
1279 <li>\r
1280 <p>\r
1281 It is a modular approach. If you don’t need a workspace bar at all, or if\r
1282    you prefer a different one (dzen2, xmobar, maybe even gnome-panel?), you can\r
1283    just remove the i3bar configuration and start your favorite bar instead.\r
1284 </p>\r
1285 </li>\r
1286 <li>\r
1287 <p>\r
1288 It follows the UNIX philosophy of "Make each program do one thing well".\r
1289    While i3 manages your windows well, i3bar is good at displaying a bar on\r
1290    each monitor (unless you configure it otherwise).\r
1291 </p>\r
1292 </li>\r
1293 <li>\r
1294 <p>\r
1295 It leads to two separate, clean codebases. If you want to understand i3, you\r
1296    don’t need to bother with the details of i3bar and vice versa.\r
1297 </p>\r
1298 </li>\r
1299 </ol></div>\r
1300 <div class="paragraph"><p>That said, i3bar is configured in the same configuration file as i3. This is\r
1301 because it is tightly coupled with i3 (in contrary to i3lock or i3status which\r
1302 are useful for people using other window managers). Therefore, it makes no\r
1303 sense to use a different configuration place when we already have a good\r
1304 configuration infrastructure in place.</p></div>\r
1305 <div class="paragraph"><p>Configuring your workspace bar starts with opening a <tt>bar</tt> block. You can have\r
1306 multiple bar blocks to use different settings for different outputs (monitors):</p></div>\r
1307 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1308 <div class="listingblock">\r
1309 <div class="content">\r
1310 <pre><tt>bar {\r
1311     status_command i3status\r
1312 }</tt></pre>\r
1313 </div></div>\r
1314 <div class="sect2">\r
1315 <h3 id="_i3bar_command">5.1. i3bar command</h3>\r
1316 <div class="paragraph"><p>By default i3 will just pass <tt>i3bar</tt> and let your shell handle the execution,\r
1317 searching your <tt>$PATH</tt> for a correct version.\r
1318 If you have a different <tt>i3bar</tt> somewhere or the binary is not in your <tt>$PATH</tt> you can\r
1319 tell i3 what to execute.</p></div>\r
1320 <div class="paragraph"><p>The specified command will be passed to <tt>sh -c</tt>, so you can use globbing and\r
1321 have to have correct quoting etc.</p></div>\r
1322 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1323 <div class="listingblock">\r
1324 <div class="content">\r
1325 <pre><tt>i3bar_command &lt;command&gt;</tt></pre>\r
1326 </div></div>\r
1327 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1328 <div class="listingblock">\r
1329 <div class="content">\r
1330 <pre><tt>bar {\r
1331     i3bar_command /home/user/bin/i3bar\r
1332 }</tt></pre>\r
1333 </div></div>\r
1334 </div>\r
1335 <div class="sect2">\r
1336 <h3 id="status_command">5.2. Statusline command</h3>\r
1337 <div class="paragraph"><p>i3bar can run a program and display every line of its <tt>stdout</tt> output on the\r
1338 right hand side of the bar. This is useful to display system information like\r
1339 your current IP address, battery status or date/time.</p></div>\r
1340 <div class="paragraph"><p>The specified command will be passed to <tt>sh -c</tt>, so you can use globbing and\r
1341 have to have correct quoting etc. Note that for signal handling, depending on\r
1342 your shell (users of dash(1) are known to be affected), you have to use the\r
1343 shell’s exec command so that signals are passed to your program, not to the\r
1344 shell.</p></div>\r
1345 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1346 <div class="listingblock">\r
1347 <div class="content">\r
1348 <pre><tt>status_command &lt;command&gt;</tt></pre>\r
1349 </div></div>\r
1350 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1351 <div class="listingblock">\r
1352 <div class="content">\r
1353 <pre><tt>bar {\r
1354     status_command i3status --config ~/.i3status.conf\r
1355 \r
1356     # For dash(1) users who want signal handling to work:\r
1357     status_command exec ~/.bin/my_status_command\r
1358 }</tt></pre>\r
1359 </div></div>\r
1360 </div>\r
1361 <div class="sect2">\r
1362 <h3 id="_display_mode">5.3. Display mode</h3>\r
1363 <div class="paragraph"><p>You can either have i3bar be visible permanently at one edge of the screen\r
1364 (<tt>dock</tt> mode) or make it show up when you press your modifier key (<tt>hide</tt> mode).\r
1365 It is also possible to force i3bar to always stay hidden (<tt>invisible</tt>\r
1366 mode). The modifier key can be configured using the <tt>modifier</tt> option.</p></div>\r
1367 <div class="paragraph"><p>The mode option can be changed during runtime through the <tt>bar mode</tt> command.\r
1368 On reload the mode will be reverted to its configured value.</p></div>\r
1369 <div class="paragraph"><p>The hide mode maximizes screen space that can be used for actual windows. Also,\r
1370 i3bar sends the <tt>SIGSTOP</tt> and <tt>SIGCONT</tt> signals to the statusline process to\r
1371 save battery power.</p></div>\r
1372 <div class="paragraph"><p>Invisible mode allows to permanently maximize screen space, as the bar is never\r
1373 shown. Thus, you can configure i3bar to not disturb you by popping up because\r
1374 of an urgency hint or because the modifier key is pressed.</p></div>\r
1375 <div class="paragraph"><p>In order to control whether i3bar is hidden or shown in hide mode, there exists\r
1376 the hidden_state option, which has no effect in dock mode or invisible mode. It\r
1377 indicates the current hidden_state of the bar: (1) The bar acts like in normal\r
1378 hide mode, it is hidden and is only unhidden in case of urgency hints or by\r
1379 pressing the modifier key (<tt>hide</tt> state), or (2) it is drawn on top of the\r
1380 currently visible workspace (<tt>show</tt> state).</p></div>\r
1381 <div class="paragraph"><p>Like the mode, the hidden_state can also be controlled through i3, this can be\r
1382 done by using the <tt>bar hidden_state</tt> command.</p></div>\r
1383 <div class="paragraph"><p>The default mode is dock mode; in hide mode, the default modifier is Mod4 (usually\r
1384 the windows key). The default value for the hidden_state is hide.</p></div>\r
1385 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1386 <div class="listingblock">\r
1387 <div class="content">\r
1388 <pre><tt>mode dock|hide|invisible\r
1389 hidden_state hide|show\r
1390 modifier &lt;Modifier&gt;|none</tt></pre>\r
1391 </div></div>\r
1392 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1393 <div class="listingblock">\r
1394 <div class="content">\r
1395 <pre><tt>bar {\r
1396     mode hide\r
1397     hidden_state hide\r
1398     modifier Mod1\r
1399 }</tt></pre>\r
1400 </div></div>\r
1401 <div class="paragraph"><p>Available modifiers are Mod1-Mod5, Shift, Control (see <tt>xmodmap(1)</tt>). You can\r
1402 also use "none" if you don&#8217;t want any modifier to trigger this behavior.</p></div>\r
1403 </div>\r
1404 <div class="sect2">\r
1405 <h3 id="_mouse_button_commands">5.4. Mouse button commands</h3>\r
1406 <div class="paragraph"><p>Specifies a command to run when a button was pressed on i3bar to override the\r
1407 default behavior. This is useful, e.g., for disabling the scroll wheel action\r
1408 or running scripts that implement custom behavior for these buttons.</p></div>\r
1409 <div class="paragraph"><p>A button is always named <tt>button&lt;n&gt;</tt>, where 1 to 5 are default buttons as follows and higher\r
1410 numbers can be special buttons on devices offering more buttons:</p></div>\r
1411 <div class="dlist"><dl>\r
1412 <dt class="hdlist1">\r
1413 button1\r
1414 </dt>\r
1415 <dd>\r
1416 <p>\r
1417     Left mouse button.\r
1418 </p>\r
1419 </dd>\r
1420 <dt class="hdlist1">\r
1421 button2\r
1422 </dt>\r
1423 <dd>\r
1424 <p>\r
1425     Middle mouse button.\r
1426 </p>\r
1427 </dd>\r
1428 <dt class="hdlist1">\r
1429 button3\r
1430 </dt>\r
1431 <dd>\r
1432 <p>\r
1433     Right mouse button.\r
1434 </p>\r
1435 </dd>\r
1436 <dt class="hdlist1">\r
1437 button4\r
1438 </dt>\r
1439 <dd>\r
1440 <p>\r
1441     Scroll wheel up.\r
1442 </p>\r
1443 </dd>\r
1444 <dt class="hdlist1">\r
1445 button5\r
1446 </dt>\r
1447 <dd>\r
1448 <p>\r
1449     Scroll wheel down.\r
1450 </p>\r
1451 </dd>\r
1452 </dl></div>\r
1453 <div class="paragraph"><p>Please note that the old <tt>wheel_up_cmd</tt> and <tt>wheel_down_cmd</tt> commands are deprecated\r
1454 and will be removed in a future release. We strongly recommend using the more general\r
1455 <tt>bindsym</tt> with <tt>button4</tt> and <tt>button5</tt> instead.</p></div>\r
1456 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1457 <div class="listingblock">\r
1458 <div class="content">\r
1459 <pre><tt>bindsym button&lt;n&gt; &lt;command&gt;</tt></pre>\r
1460 </div></div>\r
1461 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1462 <div class="listingblock">\r
1463 <div class="content">\r
1464 <pre><tt>bar {\r
1465     # disable clicking on workspace buttons\r
1466     bindsym button1 nop\r
1467     # execute custom script when scrolling downwards\r
1468     bindsym button5 exec ~/.i3/scripts/custom_wheel_down\r
1469 }</tt></pre>\r
1470 </div></div>\r
1471 </div>\r
1472 <div class="sect2">\r
1473 <h3 id="_bar_id">5.5. Bar ID</h3>\r
1474 <div class="paragraph"><p>Specifies the bar ID for the configured bar instance. If this option is missing,\r
1475 the ID is set to <em>bar-x</em>, where x corresponds to the position of the embedding\r
1476 bar block in the config file (<em>bar-0</em>, <em>bar-1</em>, &#8230;).</p></div>\r
1477 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1478 <div class="listingblock">\r
1479 <div class="content">\r
1480 <pre><tt>id &lt;bar_id&gt;</tt></pre>\r
1481 </div></div>\r
1482 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1483 <div class="listingblock">\r
1484 <div class="content">\r
1485 <pre><tt>bar {\r
1486     id bar-1\r
1487 }</tt></pre>\r
1488 </div></div>\r
1489 </div>\r
1490 <div class="sect2">\r
1491 <h3 id="i3bar_position">5.6. Position</h3>\r
1492 <div class="paragraph"><p>This option determines in which edge of the screen i3bar should show up.</p></div>\r
1493 <div class="paragraph"><p>The default is bottom.</p></div>\r
1494 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1495 <div class="listingblock">\r
1496 <div class="content">\r
1497 <pre><tt>position top|bottom</tt></pre>\r
1498 </div></div>\r
1499 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1500 <div class="listingblock">\r
1501 <div class="content">\r
1502 <pre><tt>bar {\r
1503     position top\r
1504 }</tt></pre>\r
1505 </div></div>\r
1506 </div>\r
1507 <div class="sect2">\r
1508 <h3 id="_output_s">5.7. Output(s)</h3>\r
1509 <div class="paragraph"><p>You can restrict i3bar to one or more outputs (monitors). The default is to\r
1510 handle all outputs. Restricting the outputs is useful for using different\r
1511 options for different outputs by using multiple <em>bar</em> blocks.</p></div>\r
1512 <div class="paragraph"><p>To make a particular i3bar instance handle multiple outputs, specify the output\r
1513 directive multiple times.</p></div>\r
1514 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1515 <div class="listingblock">\r
1516 <div class="content">\r
1517 <pre><tt>output primary|&lt;output&gt;</tt></pre>\r
1518 </div></div>\r
1519 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1520 <div class="listingblock">\r
1521 <div class="content">\r
1522 <pre><tt># big monitor: everything\r
1523 bar {\r
1524     # The display is connected either via HDMI or via DisplayPort\r
1525     output HDMI2\r
1526     output DP2\r
1527     status_command i3status\r
1528 }\r
1529 \r
1530 # laptop monitor: bright colors and i3status with less modules.\r
1531 bar {\r
1532     output LVDS1\r
1533     status_command i3status --config ~/.i3status-small.conf\r
1534     colors {\r
1535         background #000000\r
1536         statusline #ffffff\r
1537     }\r
1538 }\r
1539 \r
1540 # show bar on the primary monitor and on HDMI2\r
1541 bar {\r
1542     output primary\r
1543     output HDMI2\r
1544     status_command i3status\r
1545 }</tt></pre>\r
1546 </div></div>\r
1547 <div class="paragraph"><p>Note that you might not have a primary output configured yet. To do so, run:</p></div>\r
1548 <div class="listingblock">\r
1549 <div class="content">\r
1550 <pre><tt>xrandr --output &lt;output&gt; --primary</tt></pre>\r
1551 </div></div>\r
1552 </div>\r
1553 <div class="sect2">\r
1554 <h3 id="_tray_output">5.8. Tray output</h3>\r
1555 <div class="paragraph"><p>i3bar by default provides a system tray area where programs such as\r
1556 NetworkManager, VLC, Pidgin, etc. can place little icons.</p></div>\r
1557 <div class="paragraph"><p>You can configure on which output (monitor) the icons should be displayed or\r
1558 you can turn off the functionality entirely.</p></div>\r
1559 <div class="paragraph"><p>You can use multiple <tt>tray_output</tt> directives in your config to specify a list\r
1560 of outputs on which you want the tray to appear. The first available output in\r
1561 that list as defined by the order of the directives will be used for the tray\r
1562 output.</p></div>\r
1563 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1564 <div class="listingblock">\r
1565 <div class="content">\r
1566 <pre><tt>tray_output none|primary|&lt;output&gt;</tt></pre>\r
1567 </div></div>\r
1568 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1569 <div class="listingblock">\r
1570 <div class="content">\r
1571 <pre><tt># disable system tray\r
1572 bar {\r
1573     tray_output none\r
1574 }\r
1575 \r
1576 # show tray icons on the primary monitor\r
1577 bar {\r
1578     tray_output primary\r
1579 }\r
1580 \r
1581 # show tray icons on the big monitor\r
1582 bar {\r
1583     tray_output HDMI2\r
1584 }</tt></pre>\r
1585 </div></div>\r
1586 <div class="paragraph"><p>Note that you might not have a primary output configured yet. To do so, run:</p></div>\r
1587 <div class="listingblock">\r
1588 <div class="content">\r
1589 <pre><tt>xrandr --output &lt;output&gt; --primary</tt></pre>\r
1590 </div></div>\r
1591 <div class="paragraph"><p>Note that when you use multiple bar configuration blocks, either specify\r
1592 <tt>tray_output primary</tt> in all of them or explicitly specify <tt>tray_output none</tt>\r
1593 in bars which should not display the tray, otherwise the different instances\r
1594 might race each other in trying to display tray icons.</p></div>\r
1595 </div>\r
1596 <div class="sect2">\r
1597 <h3 id="_tray_padding">5.9. Tray padding</h3>\r
1598 <div class="paragraph"><p>The tray is shown on the right-hand side of the bar. By default, a padding of 2\r
1599 pixels is used for the upper, lower and right-hand side of the tray area and\r
1600 between the individual icons.</p></div>\r
1601 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1602 <div class="listingblock">\r
1603 <div class="content">\r
1604 <pre><tt>tray_padding &lt;px&gt; [px]</tt></pre>\r
1605 </div></div>\r
1606 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1607 <div class="listingblock">\r
1608 <div class="content">\r
1609 <pre><tt># Obey Fitts's law\r
1610 tray_padding 0</tt></pre>\r
1611 </div></div>\r
1612 </div>\r
1613 <div class="sect2">\r
1614 <h3 id="_font">5.10. Font</h3>\r
1615 <div class="paragraph"><p>Specifies the font to be used in the bar. See <a href="#fonts">[fonts]</a>.</p></div>\r
1616 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1617 <div class="listingblock">\r
1618 <div class="content">\r
1619 <pre><tt>font &lt;font&gt;</tt></pre>\r
1620 </div></div>\r
1621 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1622 <div class="listingblock">\r
1623 <div class="content">\r
1624 <pre><tt>bar {\r
1625     font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1\r
1626     font pango:DejaVu Sans Mono 10\r
1627 }</tt></pre>\r
1628 </div></div>\r
1629 </div>\r
1630 <div class="sect2">\r
1631 <h3 id="_custom_separator_symbol">5.11. Custom separator symbol</h3>\r
1632 <div class="paragraph"><p>Specifies a custom symbol to be used for the separator as opposed to the vertical,\r
1633 one pixel thick separator.</p></div>\r
1634 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1635 <div class="listingblock">\r
1636 <div class="content">\r
1637 <pre><tt>separator_symbol &lt;symbol&gt;</tt></pre>\r
1638 </div></div>\r
1639 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1640 <div class="listingblock">\r
1641 <div class="content">\r
1642 <pre><tt>bar {\r
1643     separator_symbol ":|:"\r
1644 }</tt></pre>\r
1645 </div></div>\r
1646 </div>\r
1647 <div class="sect2">\r
1648 <h3 id="_workspace_buttons">5.12. Workspace buttons</h3>\r
1649 <div class="paragraph"><p>Specifies whether workspace buttons should be shown or not. This is useful if\r
1650 you want to display a statusline-only bar containing additional information.</p></div>\r
1651 <div class="paragraph"><p>The default is to show workspace buttons.</p></div>\r
1652 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1653 <div class="listingblock">\r
1654 <div class="content">\r
1655 <pre><tt>workspace_buttons yes|no</tt></pre>\r
1656 </div></div>\r
1657 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1658 <div class="listingblock">\r
1659 <div class="content">\r
1660 <pre><tt>bar {\r
1661     workspace_buttons no\r
1662 }</tt></pre>\r
1663 </div></div>\r
1664 </div>\r
1665 <div class="sect2">\r
1666 <h3 id="_strip_workspace_numbers">5.13. Strip workspace numbers</h3>\r
1667 <div class="paragraph"><p>Specifies whether workspace numbers should be displayed within the workspace\r
1668 buttons. This is useful if you want to have a named workspace that stays in\r
1669 order on the bar according to its number without displaying the number prefix.</p></div>\r
1670 <div class="paragraph"><p>When <tt>strip_workspace_numbers</tt> is set to <tt>yes</tt>, any workspace that has a name of\r
1671 the form "[n]:[NAME]" will display only the name. You could use this, for\r
1672 instance, to display Roman numerals rather than digits by naming your\r
1673 workspaces to "1:I", "2:II", "3:III", "4:IV", &#8230;</p></div>\r
1674 <div class="paragraph"><p>The default is to display the full name within the workspace button.</p></div>\r
1675 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1676 <div class="listingblock">\r
1677 <div class="content">\r
1678 <pre><tt>strip_workspace_numbers yes|no</tt></pre>\r
1679 </div></div>\r
1680 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1681 <div class="listingblock">\r
1682 <div class="content">\r
1683 <pre><tt>bar {\r
1684     strip_workspace_numbers yes\r
1685 }</tt></pre>\r
1686 </div></div>\r
1687 </div>\r
1688 <div class="sect2">\r
1689 <h3 id="_binding_mode_indicator">5.14. Binding Mode indicator</h3>\r
1690 <div class="paragraph"><p>Specifies whether the current binding mode indicator should be shown or not.\r
1691 This is useful if you want to hide the workspace buttons but still be able\r
1692 to see the current binding mode indicator. See <a href="#binding_modes">[binding_modes]</a> to learn what\r
1693 modes are and how to use them.</p></div>\r
1694 <div class="paragraph"><p>The default is to show the mode indicator.</p></div>\r
1695 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1696 <div class="listingblock">\r
1697 <div class="content">\r
1698 <pre><tt>binding_mode_indicator yes|no</tt></pre>\r
1699 </div></div>\r
1700 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1701 <div class="listingblock">\r
1702 <div class="content">\r
1703 <pre><tt>bar {\r
1704     binding_mode_indicator no\r
1705 }</tt></pre>\r
1706 </div></div>\r
1707 </div>\r
1708 <div class="sect2">\r
1709 <h3 id="_colors">5.15. Colors</h3>\r
1710 <div class="paragraph"><p>As with i3, colors are in HTML hex format (#rrggbb). The following colors can\r
1711 be configured at the moment:</p></div>\r
1712 <div class="dlist"><dl>\r
1713 <dt class="hdlist1">\r
1714 background\r
1715 </dt>\r
1716 <dd>\r
1717 <p>\r
1718         Background color of the bar.\r
1719 </p>\r
1720 </dd>\r
1721 <dt class="hdlist1">\r
1722 statusline\r
1723 </dt>\r
1724 <dd>\r
1725 <p>\r
1726         Text color to be used for the statusline.\r
1727 </p>\r
1728 </dd>\r
1729 <dt class="hdlist1">\r
1730 separator\r
1731 </dt>\r
1732 <dd>\r
1733 <p>\r
1734         Text color to be used for the separator.\r
1735 </p>\r
1736 </dd>\r
1737 <dt class="hdlist1">\r
1738 focused_background\r
1739 </dt>\r
1740 <dd>\r
1741 <p>\r
1742         Background color of the bar on the currently focused monitor output. If\r
1743         not used, the color will be taken from <tt>background</tt>.\r
1744 </p>\r
1745 </dd>\r
1746 <dt class="hdlist1">\r
1747 focused_statusline\r
1748 </dt>\r
1749 <dd>\r
1750 <p>\r
1751         Text color to be used for the statusline on the currently focused\r
1752         monitor output. If not used, the color will be taken from <tt>statusline</tt>.\r
1753 </p>\r
1754 </dd>\r
1755 <dt class="hdlist1">\r
1756 focused_separator\r
1757 </dt>\r
1758 <dd>\r
1759 <p>\r
1760         Text color to be used for the separator on the currently focused\r
1761         monitor output. If not used, the color will be taken from <tt>separator</tt>.\r
1762 </p>\r
1763 </dd>\r
1764 <dt class="hdlist1">\r
1765 focused_workspace\r
1766 </dt>\r
1767 <dd>\r
1768 <p>\r
1769         Border, background and text color for a workspace button when the workspace\r
1770         has focus.\r
1771 </p>\r
1772 </dd>\r
1773 <dt class="hdlist1">\r
1774 active_workspace\r
1775 </dt>\r
1776 <dd>\r
1777 <p>\r
1778         Border, background and text color for a workspace button when the workspace\r
1779         is active (visible) on some output, but the focus is on another one.\r
1780         You can only tell this apart from the focused workspace when you are\r
1781         using multiple monitors.\r
1782 </p>\r
1783 </dd>\r
1784 <dt class="hdlist1">\r
1785 inactive_workspace\r
1786 </dt>\r
1787 <dd>\r
1788 <p>\r
1789         Border, background and text color for a workspace button when the workspace\r
1790         does not have focus and is not active (visible) on any output. This\r
1791         will be the case for most workspaces.\r
1792 </p>\r
1793 </dd>\r
1794 <dt class="hdlist1">\r
1795 urgent_workspace\r
1796 </dt>\r
1797 <dd>\r
1798 <p>\r
1799         Border, background and text color for a workspace button when the workspace\r
1800         contains a window with the urgency hint set.\r
1801 </p>\r
1802 </dd>\r
1803 <dt class="hdlist1">\r
1804 binding_mode\r
1805 </dt>\r
1806 <dd>\r
1807 <p>\r
1808         Border, background and text color for the binding mode indicator. If not used,\r
1809         the colors will be taken from <tt>urgent_workspace</tt>.\r
1810 </p>\r
1811 </dd>\r
1812 </dl></div>\r
1813 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
1814 <div class="listingblock">\r
1815 <div class="content">\r
1816 <pre><tt>colors {\r
1817     background &lt;color&gt;\r
1818     statusline &lt;color&gt;\r
1819     separator &lt;color&gt;\r
1820 \r
1821     &lt;colorclass&gt; &lt;border&gt; &lt;background&gt; &lt;text&gt;\r
1822 }</tt></pre>\r
1823 </div></div>\r
1824 <div class="paragraph"><p><strong>Example (default colors)</strong>:</p></div>\r
1825 <div class="listingblock">\r
1826 <div class="content">\r
1827 <pre><tt>bar {\r
1828     colors {\r
1829         background #000000\r
1830         statusline #ffffff\r
1831         separator #666666\r
1832 \r
1833         focused_workspace  #4c7899 #285577 #ffffff\r
1834         active_workspace   #333333 #5f676a #ffffff\r
1835         inactive_workspace #333333 #222222 #888888\r
1836         urgent_workspace   #2f343a #900000 #ffffff\r
1837         binding_mode       #2f343a #900000 #ffffff\r
1838     }\r
1839 }</tt></pre>\r
1840 </div></div>\r
1841 </div>\r
1842 </div>\r
1843 </div>\r
1844 <div class="sect1">\r
1845 <h2 id="_list_of_commands">6. List of commands</h2>\r
1846 <div class="sectionbody">\r
1847 <div class="paragraph"><p>Commands are what you bind to specific keypresses. You can also issue commands\r
1848 at runtime without pressing a key by using the IPC interface. An easy way to\r
1849 do this is to use the <tt>i3-msg</tt> utility:</p></div>\r
1850 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1851 <div class="listingblock">\r
1852 <div class="content">\r
1853 <pre><tt># execute this on your shell to make the current container borderless\r
1854 i3-msg border none</tt></pre>\r
1855 </div></div>\r
1856 <div class="paragraph" id="command_chaining"><p>Commands can be chained by using <tt>;</tt> (a semicolon). So, to move a window to a\r
1857 specific workspace and immediately switch to that workspace, you can configure\r
1858 the following keybinding:</p></div>\r
1859 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1860 <div class="listingblock">\r
1861 <div class="content">\r
1862 <pre><tt>bindsym $mod+x move container to workspace 3; workspace 3</tt></pre>\r
1863 </div></div>\r
1864 <div class="paragraph" id="command_criteria"><p>Furthermore, you can change the scope of a command - that is, which containers\r
1865 should be affected by that command, by using various criteria. The criteria\r
1866 are specified before any command in a pair of square brackets and are separated\r
1867 by space.</p></div>\r
1868 <div class="paragraph"><p>When using multiple commands, separate them by using a <tt>,</tt> (a comma) instead of\r
1869 a semicolon. Criteria apply only until the next semicolon, so if you use a\r
1870 semicolon to separate commands, only the first one will be executed for the\r
1871 matched window(s).</p></div>\r
1872 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
1873 <div class="listingblock">\r
1874 <div class="content">\r
1875 <pre><tt># if you want to kill all windows which have the class Firefox, use:\r
1876 bindsym $mod+x [class="Firefox"] kill\r
1877 \r
1878 # same thing, but case-insensitive\r
1879 bindsym $mod+x [class="(?i)firefox"] kill\r
1880 \r
1881 # kill only the About dialog from Firefox\r
1882 bindsym $mod+x [class="Firefox" window_role="About"] kill\r
1883 \r
1884 # enable floating mode and move container to workspace 4\r
1885 for_window [class="^evil-app$"] floating enable, move container to workspace 4\r
1886 \r
1887 # move all floating windows to the scratchpad\r
1888 bindsym $mod+x [floating] move scratchpad</tt></pre>\r
1889 </div></div>\r
1890 <div class="paragraph"><p>The criteria which are currently implemented are:</p></div>\r
1891 <div class="dlist"><dl>\r
1892 <dt class="hdlist1">\r
1893 class\r
1894 </dt>\r
1895 <dd>\r
1896 <p>\r
1897         Compares the window class (the second part of WM_CLASS). Use the\r
1898         special value <tt>__focused__</tt> to match all windows having the same window\r
1899         class as the currently focused window.\r
1900 </p>\r
1901 </dd>\r
1902 <dt class="hdlist1">\r
1903 instance\r
1904 </dt>\r
1905 <dd>\r
1906 <p>\r
1907         Compares the window instance (the first part of WM_CLASS). Use the\r
1908         special value <tt>__focused__</tt> to match all windows having the same window\r
1909         instance as the currently focused window.\r
1910 </p>\r
1911 </dd>\r
1912 <dt class="hdlist1">\r
1913 window_role\r
1914 </dt>\r
1915 <dd>\r
1916 <p>\r
1917         Compares the window role (WM_WINDOW_ROLE). Use the special value\r
1918         <tt>__focused__</tt> to match all windows having the same window role as the\r
1919         currently focused window.\r
1920 </p>\r
1921 </dd>\r
1922 <dt class="hdlist1">\r
1923 window_type\r
1924 </dt>\r
1925 <dd>\r
1926 <p>\r
1927         Compare the window type (_NET_WM_WINDOW_TYPE). Possible values are\r
1928         <tt>normal</tt>, <tt>dialog</tt>, <tt>utility</tt>, <tt>toolbar</tt>, <tt>splash</tt>, <tt>menu</tt>, <tt>dropdown_menu</tt>,\r
1929         <tt>popup_menu</tt>, <tt>tooltip</tt> and <tt>notification</tt>.\r
1930 </p>\r
1931 </dd>\r
1932 <dt class="hdlist1">\r
1933 id\r
1934 </dt>\r
1935 <dd>\r
1936 <p>\r
1937         Compares the X11 window ID, which you can get via <tt>xwininfo</tt> for example.\r
1938 </p>\r
1939 </dd>\r
1940 <dt class="hdlist1">\r
1941 title\r
1942 </dt>\r
1943 <dd>\r
1944 <p>\r
1945         Compares the X11 window title (_NET_WM_NAME or WM_NAME as fallback).\r
1946         Use the special value <tt>__focused__</tt> to match all windows having the\r
1947         same window title as the currently focused window.\r
1948 </p>\r
1949 </dd>\r
1950 <dt class="hdlist1">\r
1951 urgent\r
1952 </dt>\r
1953 <dd>\r
1954 <p>\r
1955         Compares the urgent state of the window. Can be "latest" or "oldest".\r
1956         Matches the latest or oldest urgent window, respectively.\r
1957         (The following aliases are also available: newest, last, recent, first)\r
1958 </p>\r
1959 </dd>\r
1960 <dt class="hdlist1">\r
1961 workspace\r
1962 </dt>\r
1963 <dd>\r
1964 <p>\r
1965         Compares the workspace name of the workspace the window belongs to. Use\r
1966         the special value <tt>__focused__</tt> to match all windows in the currently\r
1967         focused workspace.\r
1968 </p>\r
1969 </dd>\r
1970 <dt class="hdlist1">\r
1971 con_mark\r
1972 </dt>\r
1973 <dd>\r
1974 <p>\r
1975         Compares the marks set for this container, see <a href="#vim_like_marks">[vim_like_marks]</a>. A\r
1976         match is made if any of the container&#8217;s marks matches the specified\r
1977         mark.\r
1978 </p>\r
1979 </dd>\r
1980 <dt class="hdlist1">\r
1981 con_id\r
1982 </dt>\r
1983 <dd>\r
1984 <p>\r
1985         Compares the i3-internal container ID, which you can get via the IPC\r
1986         interface. Handy for scripting. Use the special value <tt>__focused__</tt>\r
1987         to match only the currently focused window.\r
1988 </p>\r
1989 </dd>\r
1990 <dt class="hdlist1">\r
1991 floating\r
1992 </dt>\r
1993 <dd>\r
1994 <p>\r
1995         Only matches floating windows. This criterion requires no value.\r
1996 </p>\r
1997 </dd>\r
1998 <dt class="hdlist1">\r
1999 tiling\r
2000 </dt>\r
2001 <dd>\r
2002 <p>\r
2003         Only matches tiling windows. This criterion requires no value.\r
2004 </p>\r
2005 </dd>\r
2006 </dl></div>\r
2007 <div class="paragraph"><p>The criteria <tt>class</tt>, <tt>instance</tt>, <tt>role</tt>, <tt>title</tt>, <tt>workspace</tt> and <tt>mark</tt> are\r
2008 actually regular expressions (PCRE). See <tt>pcresyntax(3)</tt> or <tt>perldoc perlre</tt> for\r
2009 information on how to use them.</p></div>\r
2010 <div class="sect2">\r
2011 <h3 id="exec">6.1. Executing applications (exec)</h3>\r
2012 <div class="paragraph"><p>What good is a window manager if you can’t actually start any applications?\r
2013 The exec command starts an application by passing the command you specify to a\r
2014 shell. This implies that you can use globbing (wildcards) and programs will be\r
2015 searched in your <tt>$PATH</tt>.</p></div>\r
2016 <div class="paragraph"><p>See <a href="#command_chaining">[command_chaining]</a> for details on the special meaning of <tt>;</tt> (semicolon)\r
2017 and <tt>,</tt> (comma): they chain commands together in i3, so you need to use quoted\r
2018 strings (as shown in <a href="#exec_quoting">[exec_quoting]</a>) if they appear in your command.</p></div>\r
2019 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2020 <div class="listingblock">\r
2021 <div class="content">\r
2022 <pre><tt>exec [--no-startup-id] &lt;command&gt;</tt></pre>\r
2023 </div></div>\r
2024 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
2025 <div class="listingblock">\r
2026 <div class="content">\r
2027 <pre><tt># Start the GIMP\r
2028 bindsym $mod+g exec gimp\r
2029 \r
2030 # Start the terminal emulator urxvt which is not yet startup-notification-aware\r
2031 bindsym $mod+Return exec --no-startup-id urxvt</tt></pre>\r
2032 </div></div>\r
2033 <div class="paragraph"><p>The <tt>--no-startup-id</tt> parameter disables startup-notification support for this\r
2034 particular exec command. With startup-notification, i3 can make sure that a\r
2035 window appears on the workspace on which you used the exec command. Also, it\r
2036 will change the X11 cursor to <tt>watch</tt> (a clock) while the application is\r
2037 launching. So, if an application is not startup-notification aware (most GTK\r
2038 and Qt using applications seem to be, though), you will end up with a watch\r
2039 cursor for 60 seconds.</p></div>\r
2040 <div class="paragraph" id="exec_quoting"><p>If the command to be executed contains a <tt>;</tt> (semicolon) and/or a <tt>,</tt> (comma),\r
2041 the entire command must be quoted. For example, to have a keybinding for the\r
2042 shell command <tt>notify-send Hello, i3</tt>, you would add an entry to your\r
2043 configuration file like this:</p></div>\r
2044 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
2045 <div class="listingblock">\r
2046 <div class="content">\r
2047 <pre><tt># Execute a command with a comma in it\r
2048 bindsym $mod+p exec "notify-send Hello, i3"</tt></pre>\r
2049 </div></div>\r
2050 <div class="paragraph"><p>If however a command with a comma and/or semicolon itself requires quotes, you\r
2051 must escape the internal quotation marks with double backslashes, like this:</p></div>\r
2052 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
2053 <div class="listingblock">\r
2054 <div class="content">\r
2055 <pre><tt># Execute a command with a comma, semicolon and internal quotes\r
2056 bindsym $mod+p exec "notify-send \\"Hello, i3; from $USER\\""</tt></pre>\r
2057 </div></div>\r
2058 </div>\r
2059 <div class="sect2">\r
2060 <h3 id="_splitting_containers">6.2. Splitting containers</h3>\r
2061 <div class="paragraph"><p>The split command makes the current window a split container. Split containers\r
2062 can contain multiple windows. Depending on the layout of the split container,\r
2063 new windows get placed to the right of the current one (splith) or new windows\r
2064 get placed below the current one (splitv).</p></div>\r
2065 <div class="paragraph"><p>If you apply this command to a split container with the same orientation,\r
2066 nothing will happen. If you use a different orientation, the split container’s\r
2067 orientation will be changed (if it does not have more than one window).\r
2068 The <tt>toggle</tt> option will toggle the orientation of the split container if it\r
2069 contains a single window. Otherwise it makes the current window a split\r
2070 container with opposite orientation compared to the parent container.\r
2071 Use <tt>layout toggle split</tt> to change the layout of any split container from\r
2072 splitv to splith or vice-versa. You can also define a custom sequence of layouts\r
2073 to cycle through with <tt>layout toggle</tt>, see <a href="#manipulating_layout">[manipulating_layout]</a>.</p></div>\r
2074 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2075 <div class="listingblock">\r
2076 <div class="content">\r
2077 <pre><tt>split vertical|horizontal|toggle</tt></pre>\r
2078 </div></div>\r
2079 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
2080 <div class="listingblock">\r
2081 <div class="content">\r
2082 <pre><tt>bindsym $mod+v split vertical\r
2083 bindsym $mod+h split horizontal\r
2084 bindsym $mod+t split toggle</tt></pre>\r
2085 </div></div>\r
2086 </div>\r
2087 <div class="sect2">\r
2088 <h3 id="_manipulating_layout">6.3. Manipulating layout</h3>\r
2089 <div class="paragraph"><p>Use <tt>layout toggle split</tt>, <tt>layout stacking</tt>, <tt>layout tabbed</tt>, <tt>layout splitv</tt>\r
2090 or <tt>layout splith</tt> to change the current container layout to splith/splitv,\r
2091 stacking, tabbed layout, splitv or splith, respectively.</p></div>\r
2092 <div class="paragraph"><p>Specify up to four layouts after <tt>layout toggle</tt> to cycle through them. Every\r
2093 time the command is executed, the layout specified after the currently active\r
2094 one will be applied. If the currently active layout is not in the list, the\r
2095 first layout in the list will be activated.</p></div>\r
2096 <div class="paragraph"><p>To make the current window (!) fullscreen, use <tt>fullscreen enable</tt> (or\r
2097 <tt>fullscreen enable global</tt> for the global mode), to leave either fullscreen\r
2098 mode use <tt>fullscreen disable</tt>, and to toggle between these two states use\r
2099 <tt>fullscreen toggle</tt> (or <tt>fullscreen toggle global</tt>).</p></div>\r
2100 <div class="paragraph"><p>Likewise, to make the current window floating (or tiling again) use <tt>floating\r
2101 enable</tt> respectively <tt>floating disable</tt> (or <tt>floating toggle</tt>):</p></div>\r
2102 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2103 <div class="listingblock">\r
2104 <div class="content">\r
2105 <pre><tt>layout default|tabbed|stacking|splitv|splith\r
2106 layout toggle [split|all]\r
2107 layout toggle [split|tabbed|stacking|splitv|splith] [split|tabbed|stacking|splitv|splith]…</tt></pre>\r
2108 </div></div>\r
2109 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2110 <div class="listingblock">\r
2111 <div class="content">\r
2112 <pre><tt>bindsym $mod+s layout stacking\r
2113 bindsym $mod+l layout toggle split\r
2114 bindsym $mod+w layout tabbed\r
2115 \r
2116 # Toggle between stacking/tabbed/split:\r
2117 bindsym $mod+x layout toggle\r
2118 \r
2119 # Toggle between stacking/tabbed/splith/splitv:\r
2120 bindsym $mod+x layout toggle all\r
2121 \r
2122 # Toggle between stacking/tabbed/splith:\r
2123 bindsym $mod+x layout toggle stacking tabbed splith\r
2124 \r
2125 # Toggle between splitv/tabbed\r
2126 bindsym $mod+x layout toggle splitv tabbed\r
2127 \r
2128 # Toggle between last split layout/tabbed/stacking\r
2129 bindsym $mod+x layout toggle split tabbed stacking\r
2130 \r
2131 # Toggle fullscreen\r
2132 bindsym $mod+f fullscreen toggle\r
2133 \r
2134 # Toggle floating/tiling\r
2135 bindsym $mod+t floating toggle</tt></pre>\r
2136 </div></div>\r
2137 </div>\r
2138 <div class="sect2">\r
2139 <h3 id="_focusing_moving_containers">6.4. Focusing containers</h3>\r
2140 <div class="paragraph"><p>To change focus, you can use the <tt>focus</tt> command. The following options are\r
2141 available:</p></div>\r
2142 <div class="dlist"><dl>\r
2143 <dt class="hdlist1">\r
2144 left|right|up|down\r
2145 </dt>\r
2146 <dd>\r
2147 <p>\r
2148         Sets focus to the nearest container in the given direction.\r
2149 </p>\r
2150 </dd>\r
2151 <dt class="hdlist1">\r
2152 parent\r
2153 </dt>\r
2154 <dd>\r
2155 <p>\r
2156         Sets focus to the parent container of the current container.\r
2157 </p>\r
2158 </dd>\r
2159 <dt class="hdlist1">\r
2160 child\r
2161 </dt>\r
2162 <dd>\r
2163 <p>\r
2164         The opposite of <tt>focus parent</tt>, sets the focus to the last focused\r
2165         child container.\r
2166 </p>\r
2167 </dd>\r
2168 <dt class="hdlist1">\r
2169 floating\r
2170 </dt>\r
2171 <dd>\r
2172 <p>\r
2173         Sets focus to the last focused floating container.\r
2174 </p>\r
2175 </dd>\r
2176 <dt class="hdlist1">\r
2177 tiling\r
2178 </dt>\r
2179 <dd>\r
2180 <p>\r
2181         Sets focus to the last focused tiling container.\r
2182 </p>\r
2183 </dd>\r
2184 <dt class="hdlist1">\r
2185 mode_toggle\r
2186 </dt>\r
2187 <dd>\r
2188 <p>\r
2189         Toggles between floating/tiling containers.\r
2190 </p>\r
2191 </dd>\r
2192 <dt class="hdlist1">\r
2193 output\r
2194 </dt>\r
2195 <dd>\r
2196 <p>\r
2197         Followed by a direction or an output name, this will focus the\r
2198         corresponding output.\r
2199 </p>\r
2200 </dd>\r
2201 </dl></div>\r
2202 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2203 <div class="listingblock">\r
2204 <div class="content">\r
2205 <pre><tt>focus left|right|down|up\r
2206 focus parent|child|floating|tiling|mode_toggle\r
2207 focus output left|right|up|down|primary|&lt;output&gt;</tt></pre>\r
2208 </div></div>\r
2209 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2210 <div class="listingblock">\r
2211 <div class="content">\r
2212 <pre><tt># Focus container on the left, bottom, top, right\r
2213 bindsym $mod+j focus left\r
2214 bindsym $mod+k focus down\r
2215 bindsym $mod+l focus up\r
2216 bindsym $mod+semicolon focus right\r
2217 \r
2218 # Focus parent container\r
2219 bindsym $mod+u focus parent\r
2220 \r
2221 # Focus last floating/tiling container\r
2222 bindsym $mod+g focus mode_toggle\r
2223 \r
2224 # Focus the output right to the current one\r
2225 bindsym $mod+x focus output right\r
2226 \r
2227 # Focus the big output\r
2228 bindsym $mod+x focus output HDMI-2\r
2229 \r
2230 # Focus the primary output\r
2231 bindsym $mod+x focus output primary</tt></pre>\r
2232 </div></div>\r
2233 <div class="listingblock">\r
2234 <div class="content">\r
2235 <pre><tt>Note that you might not have a primary output configured yet. To do so, run:</tt></pre>\r
2236 </div></div>\r
2237 <div class="paragraph"><p>xrandr --output &lt;output&gt; --primary</p></div>\r
2238 <div class="listingblock">\r
2239 <div class="content">\r
2240 <pre><tt>=== Moving containers\r
2241 \r
2242 Use the +move+ command to move a container.\r
2243 \r
2244 *Syntax*:</tt></pre>\r
2245 </div></div>\r
2246 <div class="paragraph"><p># Moves the container into the given direction.\r
2247 # The optional pixel argument specifies how far the\r
2248 # container should be moved if it is floating and\r
2249 # defaults to 10 pixels.\r
2250 move &lt;left|right|down|up&gt; [&lt;px&gt; px]</p></div>\r
2251 <div class="paragraph"><p># Moves the container either to a specific location\r
2252 # or to the center of the screen. If <em>absolute</em> is\r
2253 # used, it is moved to the center of all outputs.\r
2254 move [absolute] position &lt;pos_x&gt; [px] &lt;pos_y&gt; [px]\r
2255 move [absolute] position center</p></div>\r
2256 <div class="paragraph"><p># Moves the container to the current position of the\r
2257 # mouse cursor. Only affects floating containers.\r
2258 move position mouse</p></div>\r
2259 <div class="listingblock">\r
2260 <div class="content">\r
2261 <pre><tt>*Examples*:</tt></pre>\r
2262 </div></div>\r
2263 <div class="paragraph"><p># Move container to the left, bottom, top, right\r
2264 bindsym $mod+j move left\r
2265 bindsym $mod+k move down\r
2266 bindsym $mod+l move up\r
2267 bindsym $mod+semicolon move right</p></div>\r
2268 <div class="paragraph"><p># Move container, but make floating containers\r
2269 # move more than the default\r
2270 bindsym $mod+j move left 20 px</p></div>\r
2271 <div class="paragraph"><p># Move floating container to the center of all outputs\r
2272 bindsym $mod+c move absolute position center</p></div>\r
2273 <div class="paragraph"><p># Move container to the current position of the cursor\r
2274 bindsym $mod+m move position mouse</p></div>\r
2275 <div class="listingblock">\r
2276 <div class="content">\r
2277 <pre><tt>=== Swapping containers\r
2278 \r
2279 Two containers can be swapped (i.e., move to each other's position) by using\r
2280 the +swap+ command. They will assume the position and geometry of the container\r
2281 they are swapped with.\r
2282 \r
2283 The first container to participate in the swapping can be selected through the\r
2284 normal command criteria process with the focused window being the usual\r
2285 fallback if no criteria are specified. The second container can be selected\r
2286 using one of the following methods:\r
2287 \r
2288 +id+:: The X11 window ID of a client window.\r
2289 +con_id+:: The i3 container ID of a container.\r
2290 +mark+:: A container with the specified mark, see &lt;&lt;vim_like_marks&gt;&gt;.\r
2291 \r
2292 Note that swapping does not work with all containers. Most notably, swapping\r
2293 floating containers or containers that have a parent-child relationship to one\r
2294 another does not work.\r
2295 \r
2296 *Syntax*:</tt></pre>\r
2297 </div></div>\r
2298 </div>\r
2299 </div>\r
2300 </div>\r
2301 <div class="sect1">\r
2302 <h2 id="_swap_container_with_id_con_id_mark_lt_arg_gt">7. swap container with id|con_id|mark &lt;arg&gt;</h2>\r
2303 <div class="sectionbody">\r
2304 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2305 <div class="listingblock">\r
2306 <div class="content">\r
2307 <pre><tt># Swaps the focused container with the container marked »swapee«.\r
2308 swap container with mark swapee\r
2309 \r
2310 # Swaps container marked »A« and »B«\r
2311 [con_mark="^A$"] swap container with mark B</tt></pre>\r
2312 </div></div>\r
2313 <div class="sect2">\r
2314 <h3 id="_sticky_floating_windows">7.1. Sticky floating windows</h3>\r
2315 <div class="paragraph"><p>If you want a window to stick to the glass, i.e., have it stay on screen even\r
2316 if you switch to another workspace, you can use the <tt>sticky</tt> command. For\r
2317 example, this can be useful for notepads, a media player or a video chat\r
2318 window.</p></div>\r
2319 <div class="paragraph"><p>Note that while any window can be made sticky through this command, it will\r
2320 only take effect if the window is floating.</p></div>\r
2321 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2322 <div class="listingblock">\r
2323 <div class="content">\r
2324 <pre><tt>sticky enable|disable|toggle</tt></pre>\r
2325 </div></div>\r
2326 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2327 <div class="listingblock">\r
2328 <div class="content">\r
2329 <pre><tt># make a terminal sticky that was started as a notepad\r
2330 for_window [instance=notepad] sticky enable</tt></pre>\r
2331 </div></div>\r
2332 </div>\r
2333 <div class="sect2">\r
2334 <h3 id="_changing_named_workspaces_moving_to_workspaces">7.2. Changing (named) workspaces/moving to workspaces</h3>\r
2335 <div class="paragraph"><p>To change to a specific workspace, use the <tt>workspace</tt> command, followed by the\r
2336 number or name of the workspace. Pass the optional flag\r
2337 <tt>--no-auto-back-and-forth</tt> to disable <a href="#back_and_forth">[back_and_forth]</a> for this specific call\r
2338 only.</p></div>\r
2339 <div class="paragraph"><p>To move containers to specific workspaces, use <tt>move container to workspace</tt>.</p></div>\r
2340 <div class="paragraph"><p>You can also switch to the next and previous workspace with the commands\r
2341 <tt>workspace next</tt> and <tt>workspace prev</tt>, which is handy, for example, if you have\r
2342 workspace 1, 3, 4 and 9 and you want to cycle through them with a single key\r
2343 combination. To restrict those to the current output, use <tt>workspace\r
2344 next_on_output</tt> and <tt>workspace prev_on_output</tt>. Similarly, you can use <tt>move\r
2345 container to workspace next</tt>, <tt>move container to workspace prev</tt> to move a\r
2346 container to the next/previous workspace and <tt>move container to workspace current</tt>\r
2347 (the last one makes sense only when used with criteria).</p></div>\r
2348 <div class="paragraph"><p><tt>workspace next</tt> cycles through either numbered or named workspaces. But when it\r
2349 reaches the last numbered/named workspace, it looks for named workspaces after\r
2350 exhausting numbered ones and looks for numbered ones after exhausting named ones.</p></div>\r
2351 <div class="paragraph"><p>See <a href="#move_to_outputs">[move_to_outputs]</a> for how to move a container/workspace to a different\r
2352 RandR output.</p></div>\r
2353 <div class="paragraph"><p>Workspace names are parsed as\r
2354 <a href="https://developer.gnome.org/pango/stable/PangoMarkupFormat.html">Pango markup</a>\r
2355 by i3bar.</p></div>\r
2356 <div class="paragraph" id="back_and_forth"><p>To switch back to the previously focused workspace, use <tt>workspace\r
2357 back_and_forth</tt>; likewise, you can move containers to the previously focused\r
2358 workspace using <tt>move container to workspace back_and_forth</tt>.</p></div>\r
2359 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2360 <div class="listingblock">\r
2361 <div class="content">\r
2362 <pre><tt>workspace next|prev|next_on_output|prev_on_output\r
2363 workspace back_and_forth\r
2364 workspace [--no-auto-back-and-forth] &lt;name&gt;\r
2365 workspace [--no-auto-back-and-forth] number &lt;name&gt;\r
2366 \r
2367 move [--no-auto-back-and-forth] [window|container] [to] workspace &lt;name&gt;\r
2368 move [--no-auto-back-and-forth] [window|container] [to] workspace number &lt;name&gt;\r
2369 move [window|container] [to] workspace prev|next|current</tt></pre>\r
2370 </div></div>\r
2371 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2372 <div class="listingblock">\r
2373 <div class="content">\r
2374 <pre><tt>bindsym $mod+1 workspace 1\r
2375 bindsym $mod+2 workspace 2\r
2376 bindsym $mod+3 workspace 3:&lt;span foreground="red"&gt;vim&lt;/span&gt;\r
2377 ...\r
2378 \r
2379 bindsym $mod+Shift+1 move container to workspace 1\r
2380 bindsym $mod+Shift+2 move container to workspace 2\r
2381 ...\r
2382 \r
2383 # switch between the current and the previously focused one\r
2384 bindsym $mod+b workspace back_and_forth\r
2385 bindsym $mod+Shift+b move container to workspace back_and_forth\r
2386 \r
2387 # move the whole workspace to the next output\r
2388 bindsym $mod+x move workspace to output right\r
2389 \r
2390 # move firefox to current workspace\r
2391 bindsym $mod+F1 [class="Firefox"] move workspace current</tt></pre>\r
2392 </div></div>\r
2393 <div class="sect3">\r
2394 <h4 id="_named_workspaces">7.2.1. Named workspaces</h4>\r
2395 <div class="paragraph"><p>Workspaces are identified by their name. So, instead of using numbers in the\r
2396 workspace command, you can use an arbitrary name:</p></div>\r
2397 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
2398 <div class="listingblock">\r
2399 <div class="content">\r
2400 <pre><tt>bindsym $mod+1 workspace mail\r
2401 ...</tt></pre>\r
2402 </div></div>\r
2403 <div class="paragraph"><p>If you want the workspace to have a number <strong>and</strong> a name, just prefix the\r
2404 number, like this:</p></div>\r
2405 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
2406 <div class="listingblock">\r
2407 <div class="content">\r
2408 <pre><tt>bindsym $mod+1 workspace 1: mail\r
2409 bindsym $mod+2 workspace 2: www\r
2410 ...</tt></pre>\r
2411 </div></div>\r
2412 <div class="paragraph"><p>Note that the workspace will really be named "1: mail". i3 treats workspace\r
2413 names beginning with a number in a slightly special way. Normally, named\r
2414 workspaces are ordered the way they appeared. When they start with a number, i3\r
2415 will order them numerically. Also, you will be able to use <tt>workspace number 1</tt>\r
2416 to switch to the workspace which begins with number 1, regardless of which name\r
2417 it has. This is useful in case you are changing the workspace’s name\r
2418 dynamically. To combine both commands you can use <tt>workspace number 1: mail</tt> to\r
2419 specify a default name if there&#8217;s currently no workspace starting with a "1".</p></div>\r
2420 </div>\r
2421 <div class="sect3">\r
2422 <h4 id="_renaming_workspaces">7.2.2. Renaming workspaces</h4>\r
2423 <div class="paragraph"><p>You can rename workspaces. This might be useful to start with the default\r
2424 numbered workspaces, do your work, and rename the workspaces afterwards to\r
2425 reflect what’s actually on them. You can also omit the old name to rename\r
2426 the currently focused workspace. This is handy if you want to use the\r
2427 rename command with <tt>i3-input</tt>.</p></div>\r
2428 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2429 <div class="listingblock">\r
2430 <div class="content">\r
2431 <pre><tt>rename workspace &lt;old_name&gt; to &lt;new_name&gt;\r
2432 rename workspace to &lt;new_name&gt;</tt></pre>\r
2433 </div></div>\r
2434 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2435 <div class="listingblock">\r
2436 <div class="content">\r
2437 <pre><tt>i3-msg 'rename workspace 5 to 6'\r
2438 i3-msg 'rename workspace 1 to "1: www"'\r
2439 i3-msg 'rename workspace "1: www" to "10: www"'\r
2440 i3-msg 'rename workspace to "2: mail"'\r
2441 bindsym $mod+r exec i3-input -F 'rename workspace to "%s"' -P 'New name: '</tt></pre>\r
2442 </div></div>\r
2443 <div class="paragraph"><p>If you want to rename workspaces on demand while keeping the navigation stable,\r
2444 you can use a setup like this:</p></div>\r
2445 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
2446 <div class="listingblock">\r
2447 <div class="content">\r
2448 <pre><tt>bindsym $mod+1 workspace number "1: www"\r
2449 bindsym $mod+2 workspace number "2: mail"\r
2450 ...</tt></pre>\r
2451 </div></div>\r
2452 <div class="paragraph"><p>If a workspace does not exist, the command <tt>workspace number "1: mail"</tt> will\r
2453 create workspace "1: mail".</p></div>\r
2454 <div class="paragraph"><p>If a workspace with number 1 does already exist, the command will switch to this\r
2455 workspace and ignore the text part. So even when the workspace has been renamed\r
2456 to "1: web", the above command will still switch to it.</p></div>\r
2457 </div>\r
2458 </div>\r
2459 <div class="sect2">\r
2460 <h3 id="_moving_workspaces_to_a_different_screen">7.3. Moving workspaces to a different screen</h3>\r
2461 <div class="paragraph"><p>See <a href="#move_to_outputs">[move_to_outputs]</a> for how to move a container/workspace to a different\r
2462 RandR output.</p></div>\r
2463 </div>\r
2464 <div class="sect2">\r
2465 <h3 id="_moving_containers_workspaces_to_randr_outputs">7.4. Moving containers/workspaces to RandR outputs</h3>\r
2466 <div class="paragraph"><p>To move a container to another RandR output (addressed by names like <tt>LVDS1</tt> or\r
2467 <tt>VGA1</tt>) or to a RandR output identified by a specific direction (like <tt>left</tt>,\r
2468 <tt>right</tt>, <tt>up</tt> or <tt>down</tt>), there are two commands:</p></div>\r
2469 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2470 <div class="listingblock">\r
2471 <div class="content">\r
2472 <pre><tt>move container to output left|right|down|up|current|primary|&lt;output&gt;\r
2473 move workspace to output left|right|down|up|current|primary|&lt;output&gt;</tt></pre>\r
2474 </div></div>\r
2475 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2476 <div class="listingblock">\r
2477 <div class="content">\r
2478 <pre><tt># Move the current workspace to the next output\r
2479 # (effectively toggles when you only have two outputs)\r
2480 bindsym $mod+x move workspace to output right\r
2481 \r
2482 # Put this window on the presentation output.\r
2483 bindsym $mod+x move container to output VGA1\r
2484 \r
2485 # Put this window on the primary output.\r
2486 bindsym $mod+x move container to output primary</tt></pre>\r
2487 </div></div>\r
2488 <div class="listingblock">\r
2489 <div class="content">\r
2490 <pre><tt>Note that you might not have a primary output configured yet. To do so, run:</tt></pre>\r
2491 </div></div>\r
2492 <div class="paragraph"><p>xrandr --output &lt;output&gt; --primary</p></div>\r
2493 <div class="listingblock">\r
2494 <div class="content">\r
2495 <pre><tt>=== Moving containers/windows to marks\r
2496 \r
2497 To move a container to another container with a specific mark (see &lt;&lt;vim_like_marks&gt;&gt;),\r
2498 you can use the following command.\r
2499 \r
2500 The window will be moved right after the marked container in the tree, i.e., it ends up\r
2501 in the same position as if you had opened a new window when the marked container was\r
2502 focused. If the mark is on a split container, the window will appear as a new child\r
2503 after the currently focused child within that container.\r
2504 \r
2505 *Syntax*:</tt></pre>\r
2506 </div></div>\r
2507 </div>\r
2508 </div>\r
2509 </div>\r
2510 <div class="sect1">\r
2511 <h2 id="_move_window_container_to_mark_lt_mark_gt">8. move window|container to mark &lt;mark&gt;</h2>\r
2512 <div class="sectionbody">\r
2513 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
2514 <div class="listingblock">\r
2515 <div class="content">\r
2516 <pre><tt>for_window [instance="tabme"] move window to mark target</tt></pre>\r
2517 </div></div>\r
2518 <div class="sect2">\r
2519 <h3 id="resizingconfig">8.1. Resizing containers/windows</h3>\r
2520 <div class="paragraph"><p>If you want to resize containers/windows using your keyboard, you can use the\r
2521 <tt>resize</tt> command:</p></div>\r
2522 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2523 <div class="listingblock">\r
2524 <div class="content">\r
2525 <pre><tt>resize grow|shrink &lt;direction&gt; [&lt;px&gt; px [or &lt;ppt&gt; ppt]]\r
2526 resize set &lt;width&gt; [px] &lt;height&gt; [px]</tt></pre>\r
2527 </div></div>\r
2528 <div class="paragraph"><p>Direction can either be one of <tt>up</tt>, <tt>down</tt>, <tt>left</tt> or <tt>right</tt>. Or you can be\r
2529 less specific and use <tt>width</tt> or <tt>height</tt>, in which case i3 will take/give\r
2530 space from all the other containers. The optional pixel argument specifies by\r
2531 how many pixels a <strong>floating container</strong> should be grown or shrunk (the default\r
2532 is 10 pixels). The ppt argument means percentage points and specifies by how\r
2533 many percentage points a <strong>tiling container</strong> should be grown or shrunk (the\r
2534 default is 10 percentage points). Note that <tt>resize set</tt> will only work for\r
2535 floating containers.</p></div>\r
2536 <div class="paragraph"><p>It is recommended to define bindings for resizing in a dedicated binding mode.\r
2537 See <a href="#binding_modes">[binding_modes]</a> and the example in the i3\r
2538 <a href="https://github.com/i3/i3/blob/next/etc/config.keycodes">default config</a> for more\r
2539 context.</p></div>\r
2540 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
2541 <div class="listingblock">\r
2542 <div class="content">\r
2543 <pre><tt>for_window [class="urxvt"] resize set 640 480</tt></pre>\r
2544 </div></div>\r
2545 </div>\r
2546 <div class="sect2">\r
2547 <h3 id="_jumping_to_specific_windows">8.2. Jumping to specific windows</h3>\r
2548 <div class="paragraph"><p>Often when in a multi-monitor environment, you want to quickly jump to a\r
2549 specific window. For example, while working on workspace 3 you may want to\r
2550 jump to your mail client to email your boss that you’ve achieved some\r
2551 important goal. Instead of figuring out how to navigate to your mail client,\r
2552 it would be more convenient to have a shortcut. You can use the <tt>focus</tt> command\r
2553 with criteria for that.</p></div>\r
2554 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2555 <div class="listingblock">\r
2556 <div class="content">\r
2557 <pre><tt>[class="class"] focus\r
2558 [title="title"] focus</tt></pre>\r
2559 </div></div>\r
2560 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2561 <div class="listingblock">\r
2562 <div class="content">\r
2563 <pre><tt># Get me to the next open VIM instance\r
2564 bindsym $mod+a [class="urxvt" title="VIM"] focus</tt></pre>\r
2565 </div></div>\r
2566 </div>\r
2567 <div class="sect2">\r
2568 <h3 id="vim_like_marks">8.3. VIM-like marks (mark/goto)</h3>\r
2569 <div class="paragraph"><p>This feature is like the jump feature: It allows you to directly jump to a\r
2570 specific window (this means switching to the appropriate workspace and setting\r
2571 focus to the windows). However, you can directly mark a specific window with\r
2572 an arbitrary label and use it afterwards. You can unmark the label in the same\r
2573 way, using the unmark command. If you don&#8217;t specify a label, unmark removes all\r
2574 marks. You do not need to ensure that your windows have unique classes or\r
2575 titles, and you do not need to change your configuration file.</p></div>\r
2576 <div class="paragraph"><p>As the command needs to include the label with which you want to mark the\r
2577 window, you cannot simply bind it to a key.  <tt>i3-input</tt> is a tool created\r
2578 for this purpose: It lets you input a command and sends the command to i3. It\r
2579 can also prefix this command and display a custom prompt for the input dialog.</p></div>\r
2580 <div class="paragraph"><p>The additional <tt>--toggle</tt> option will remove the mark if the window already has\r
2581 this mark or add it otherwise. Note that you may need to use this in\r
2582 combination with <tt>--add</tt> (see below) as any other marks will otherwise be\r
2583 removed.</p></div>\r
2584 <div class="paragraph"><p>By default, a window can only have one mark. You can use the <tt>--add</tt> flag to\r
2585 put more than one mark on a window.</p></div>\r
2586 <div class="paragraph"><p>Refer to <a href="#show_marks">[show_marks]</a> if you don&#8217;t want marks to be shown in the window decoration.</p></div>\r
2587 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2588 <div class="listingblock">\r
2589 <div class="content">\r
2590 <pre><tt>mark [--add|--replace] [--toggle] &lt;identifier&gt;\r
2591 [con_mark="identifier"] focus\r
2592 unmark &lt;identifier&gt;</tt></pre>\r
2593 </div></div>\r
2594 <div class="paragraph"><p><strong>Example (in a terminal)</strong>:</p></div>\r
2595 <div class="listingblock">\r
2596 <div class="content">\r
2597 <pre><tt># marks the focused container\r
2598 mark irssi\r
2599 \r
2600 # focus the container with the mark "irssi"\r
2601 '[con_mark="irssi"] focus'\r
2602 \r
2603 # remove the mark "irssi" from whichever container has it\r
2604 unmark irssi\r
2605 \r
2606 # remove all marks on all firefox windows\r
2607 [class="(?i)firefox"] unmark</tt></pre>\r
2608 </div></div>\r
2609 </div>\r
2610 <div class="sect2">\r
2611 <h3 id="pango_markup">8.4. Window title format</h3>\r
2612 <div class="paragraph"><p>By default, i3 will simply print the X11 window title. Using <tt>title_format</tt>,\r
2613 this can be customized by setting the format to the desired output. This\r
2614 directive supports\r
2615 <a href="https://developer.gnome.org/pango/stable/PangoMarkupFormat.html">Pango markup</a>\r
2616 and the following placeholders which will be replaced:</p></div>\r
2617 <div class="dlist"><dl>\r
2618 <dt class="hdlist1">\r
2619 <tt>%title</tt>\r
2620 </dt>\r
2621 <dd>\r
2622 <p>\r
2623     For normal windows, this is the X11 window title (_NET_WM_NAME or WM_NAME\r
2624     as fallback). When used on containers without a window (e.g., a split\r
2625     container inside a tabbed/stacked layout), this will be the tree\r
2626     representation of the container (e.g., "H[xterm xterm]").\r
2627 </p>\r
2628 </dd>\r
2629 <dt class="hdlist1">\r
2630 <tt>%class</tt>\r
2631 </dt>\r
2632 <dd>\r
2633 <p>\r
2634     The X11 window class (second part of WM_CLASS). This corresponds to the\r
2635     <tt>class</tt> criterion, see <a href="#command_criteria">[command_criteria]</a>.\r
2636 </p>\r
2637 </dd>\r
2638 <dt class="hdlist1">\r
2639 <tt>%instance</tt>\r
2640 </dt>\r
2641 <dd>\r
2642 <p>\r
2643     The X11 window instance (first part of WM_CLASS). This corresponds to the\r
2644     <tt>instance</tt> criterion, see <a href="#command_criteria">[command_criteria]</a>.\r
2645 </p>\r
2646 </dd>\r
2647 </dl></div>\r
2648 <div class="paragraph"><p>Using the <a href="#for_window">[for_window]</a> directive, you can set the title format for any window\r
2649 based on <a href="#command_criteria">[command_criteria]</a>.</p></div>\r
2650 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2651 <div class="listingblock">\r
2652 <div class="content">\r
2653 <pre><tt>title_format &lt;format&gt;</tt></pre>\r
2654 </div></div>\r
2655 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2656 <div class="listingblock">\r
2657 <div class="content">\r
2658 <pre><tt># give the focused window a prefix\r
2659 bindsym $mod+p title_format "Important | %title"\r
2660 \r
2661 # print all window titles bold\r
2662 for_window [class=".*"] title_format "&lt;b&gt;%title&lt;/b&gt;"\r
2663 \r
2664 # print window titles of firefox windows red\r
2665 for_window [class="(?i)firefox"] title_format "&lt;span foreground='red'&gt;%title&lt;/span&gt;"</tt></pre>\r
2666 </div></div>\r
2667 </div>\r
2668 <div class="sect2">\r
2669 <h3 id="_changing_border_style">8.5. Changing border style</h3>\r
2670 <div class="paragraph"><p>To change the border of the current client, you can use <tt>border normal</tt> to use the normal\r
2671 border (including window title), <tt>border pixel 1</tt> to use a 1-pixel border (no window title)\r
2672 and <tt>border none</tt> to make the client borderless.</p></div>\r
2673 <div class="paragraph"><p>There is also <tt>border toggle</tt> which will toggle the different border styles.</p></div>\r
2674 <div class="paragraph"><p>Note that "pixel" refers to logical pixel. On HiDPI displays, a logical pixel\r
2675 may be represented by multiple physical pixels, so <tt>pixel 1</tt> might not\r
2676 necessarily translate into a single pixel row wide border.</p></div>\r
2677 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2678 <div class="listingblock">\r
2679 <div class="content">\r
2680 <pre><tt>border normal|pixel [&lt;n&gt;]\r
2681 border none|toggle\r
2682 \r
2683 # legacy syntax, equivalent to "border pixel 1"\r
2684 border 1pixel</tt></pre>\r
2685 </div></div>\r
2686 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2687 <div class="listingblock">\r
2688 <div class="content">\r
2689 <pre><tt># use window title, but no border\r
2690 bindsym $mod+t border normal 0\r
2691 # use no window title and a thick border\r
2692 bindsym $mod+y border pixel 3\r
2693 # use neither window title nor border\r
2694 bindsym $mod+u border none</tt></pre>\r
2695 </div></div>\r
2696 </div>\r
2697 <div class="sect2">\r
2698 <h3 id="shmlog">8.6. Enabling shared memory logging</h3>\r
2699 <div class="paragraph"><p>As described in <a href="http://i3wm.org/docs/debugging.html">http://i3wm.org/docs/debugging.html</a>, i3 can log to a shared\r
2700 memory buffer, which you can dump using <tt>i3-dump-log</tt>. The <tt>shmlog</tt> command\r
2701 allows you to enable or disable the shared memory logging at runtime.</p></div>\r
2702 <div class="paragraph"><p>Note that when using <tt>shmlog &lt;size_in_bytes&gt;</tt>, the current log will be\r
2703 discarded and a new one will be started.</p></div>\r
2704 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2705 <div class="listingblock">\r
2706 <div class="content">\r
2707 <pre><tt>shmlog &lt;size_in_bytes&gt;\r
2708 shmlog on|off|toggle</tt></pre>\r
2709 </div></div>\r
2710 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2711 <div class="listingblock">\r
2712 <div class="content">\r
2713 <pre><tt># Enable/disable logging\r
2714 bindsym $mod+x shmlog toggle\r
2715 \r
2716 # or, from a terminal:\r
2717 # increase the shared memory log buffer to 50 MiB\r
2718 i3-msg shmlog $((50*1024*1024))</tt></pre>\r
2719 </div></div>\r
2720 </div>\r
2721 <div class="sect2">\r
2722 <h3 id="_enabling_debug_logging">8.7. Enabling debug logging</h3>\r
2723 <div class="paragraph"><p>The <tt>debuglog</tt> command allows you to enable or disable debug logging at\r
2724 runtime. Debug logging is much more verbose than non-debug logging. This\r
2725 command does not activate shared memory logging (shmlog), and as such is most\r
2726 likely useful in combination with the above-described <a href="#shmlog">[shmlog]</a> command.</p></div>\r
2727 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2728 <div class="listingblock">\r
2729 <div class="content">\r
2730 <pre><tt>debuglog on|off|toggle</tt></pre>\r
2731 </div></div>\r
2732 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2733 <div class="listingblock">\r
2734 <div class="content">\r
2735 <pre><tt># Enable/disable logging\r
2736 bindsym $mod+x debuglog toggle</tt></pre>\r
2737 </div></div>\r
2738 </div>\r
2739 <div class="sect2">\r
2740 <h3 id="_reloading_restarting_exiting">8.8. Reloading/Restarting/Exiting</h3>\r
2741 <div class="paragraph"><p>You can make i3 reload its configuration file with <tt>reload</tt>. You can also\r
2742 restart i3 inplace with the <tt>restart</tt> command to get it out of some weird state\r
2743 (if that should ever happen) or to perform an upgrade without having to restart\r
2744 your X session. To exit i3 properly, you can use the <tt>exit</tt> command,\r
2745 however you don’t need to (simply killing your X session is fine as well).</p></div>\r
2746 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2747 <div class="listingblock">\r
2748 <div class="content">\r
2749 <pre><tt>bindsym $mod+Shift+r restart\r
2750 bindsym $mod+Shift+w reload\r
2751 bindsym $mod+Shift+e exit</tt></pre>\r
2752 </div></div>\r
2753 </div>\r
2754 <div class="sect2">\r
2755 <h3 id="_scratchpad">8.9. Scratchpad</h3>\r
2756 <div class="paragraph"><p>There are two commands to use any existing window as scratchpad window. <tt>move\r
2757 scratchpad</tt> will move a window to the scratchpad workspace. This will make it\r
2758 invisible until you show it again. There is no way to open that workspace.\r
2759 Instead, when using <tt>scratchpad show</tt>, the window will be shown again, as a\r
2760 floating window, centered on your current workspace (using <tt>scratchpad show</tt> on\r
2761 a visible scratchpad window will make it hidden again, so you can have a\r
2762 keybinding to toggle). Note that this is just a normal floating window, so if\r
2763 you want to "remove it from scratchpad", you can simple make it tiling again\r
2764 (<tt>floating toggle</tt>).</p></div>\r
2765 <div class="paragraph"><p>As the name indicates, this is useful for having a window with your favorite\r
2766 editor always at hand. However, you can also use this for other permanently\r
2767 running applications which you don’t want to see all the time: Your music\r
2768 player, alsamixer, maybe even your mail client…?</p></div>\r
2769 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2770 <div class="listingblock">\r
2771 <div class="content">\r
2772 <pre><tt>move scratchpad\r
2773 \r
2774 scratchpad show</tt></pre>\r
2775 </div></div>\r
2776 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2777 <div class="listingblock">\r
2778 <div class="content">\r
2779 <pre><tt># Make the currently focused window a scratchpad\r
2780 bindsym $mod+Shift+minus move scratchpad\r
2781 \r
2782 # Show the first scratchpad window\r
2783 bindsym $mod+minus scratchpad show\r
2784 \r
2785 # Show the sup-mail scratchpad window, if any.\r
2786 bindsym mod4+s [title="^Sup ::"] scratchpad show</tt></pre>\r
2787 </div></div>\r
2788 </div>\r
2789 <div class="sect2">\r
2790 <h3 id="_nop">8.10. Nop</h3>\r
2791 <div class="paragraph"><p>There is a no operation command <tt>nop</tt> which allows you to override default\r
2792 behavior. This can be useful for, e.g., disabling a focus change on clicks with\r
2793 the middle mouse button.</p></div>\r
2794 <div class="paragraph"><p>The optional <tt>comment</tt> argument is ignored, but will be printed to the log file\r
2795 for debugging purposes.</p></div>\r
2796 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2797 <div class="listingblock">\r
2798 <div class="content">\r
2799 <pre><tt>nop [&lt;comment&gt;]</tt></pre>\r
2800 </div></div>\r
2801 <div class="paragraph"><p><strong>Example</strong>:</p></div>\r
2802 <div class="listingblock">\r
2803 <div class="content">\r
2804 <pre><tt># Disable focus change for clicks on titlebars\r
2805 # with the middle mouse button\r
2806 bindsym button2 nop</tt></pre>\r
2807 </div></div>\r
2808 </div>\r
2809 <div class="sect2">\r
2810 <h3 id="_i3bar_control">8.11. i3bar control</h3>\r
2811 <div class="paragraph"><p>There are two options in the configuration of each i3bar instance that can be\r
2812 changed during runtime by invoking a command through i3. The commands <tt>bar\r
2813 hidden_state</tt> and <tt>bar mode</tt> allow setting the current hidden_state\r
2814 respectively mode option of each bar. It is also possible to toggle between\r
2815 hide state and show state as well as between dock mode and hide mode. Each\r
2816 i3bar instance can be controlled individually by specifying a bar_id, if none\r
2817 is given, the command is executed for all bar instances.</p></div>\r
2818 <div class="paragraph"><p><strong>Syntax</strong>:</p></div>\r
2819 <div class="listingblock">\r
2820 <div class="content">\r
2821 <pre><tt>bar hidden_state hide|show|toggle [&lt;bar_id&gt;]\r
2822 \r
2823 bar mode dock|hide|invisible|toggle [&lt;bar_id&gt;]</tt></pre>\r
2824 </div></div>\r
2825 <div class="paragraph"><p><strong>Examples</strong>:</p></div>\r
2826 <div class="listingblock">\r
2827 <div class="content">\r
2828 <pre><tt># Toggle between hide state and show state\r
2829 bindsym $mod+m bar hidden_state toggle\r
2830 \r
2831 # Toggle between dock mode and hide mode\r
2832 bindsym $mod+n bar mode toggle\r
2833 \r
2834 # Set the bar instance with id 'bar-1' to switch to hide mode\r
2835 bindsym $mod+b bar mode hide bar-1\r
2836 \r
2837 # Set the bar instance with id 'bar-1' to always stay hidden\r
2838 bindsym $mod+Shift+b bar mode invisible bar-1</tt></pre>\r
2839 </div></div>\r
2840 </div>\r
2841 </div>\r
2842 </div>\r
2843 <div class="sect1">\r
2844 <h2 id="multi_monitor">9. Multiple monitors</h2>\r
2845 <div class="sectionbody">\r
2846 <div class="paragraph"><p>As you can see in the goal list on the website, i3 was specifically developed\r
2847 with support for multiple monitors in mind. This section will explain how to\r
2848 handle multiple monitors.</p></div>\r
2849 <div class="paragraph"><p>When you have only one monitor, things are simple. You usually start with\r
2850 workspace 1 on your monitor and open new ones as you need them.</p></div>\r
2851 <div class="paragraph"><p>When you have more than one monitor, each monitor will get an initial\r
2852 workspace.  The first monitor gets 1, the second gets 2 and a possible third\r
2853 would get 3. When you switch to a workspace on a different monitor, i3 will\r
2854 switch to that monitor and then switch to the workspace. This way, you don’t\r
2855 need shortcuts to switch to a specific monitor, and you don’t need to remember\r
2856 where you put which workspace. New workspaces will be opened on the currently\r
2857 active monitor.  It is not possible to have a monitor without a workspace.</p></div>\r
2858 <div class="paragraph"><p>The idea of making workspaces global is based on the observation that most\r
2859 users have a very limited set of workspaces on their additional monitors.\r
2860 They are often used for a specific task (browser, shell) or for monitoring\r
2861 several things (mail, IRC, syslog, …). Thus, using one workspace on one monitor\r
2862 and "the rest" on the other monitors often makes sense. However, as you can\r
2863 create an unlimited number of workspaces in i3 and tie them to specific\r
2864 screens, you can have the "traditional" approach of having X workspaces per\r
2865 screen by changing your configuration (using modes, for example).</p></div>\r
2866 <div class="sect2">\r
2867 <h3 id="_configuring_your_monitors">9.1. Configuring your monitors</h3>\r
2868 <div class="paragraph"><p>To help you get going if you have never used multiple monitors before, here is\r
2869 a short overview of the xrandr options which will probably be of interest to\r
2870 you. It is always useful to get an overview of the current screen configuration.\r
2871 Just run "xrandr" and you will get an output like the following:</p></div>\r
2872 <div class="listingblock">\r
2873 <div class="content">\r
2874 <pre><tt>$ xrandr\r
2875 Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192\r
2876 VGA1 disconnected (normal left inverted right x axis y axis)\r
2877 LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm\r
2878    1280x800       60.0*+   50.0\r
2879    1024x768       85.0     75.0     70.1     60.0\r
2880    832x624        74.6\r
2881    800x600        85.1     72.2     75.0     60.3     56.2\r
2882    640x480        85.0     72.8     75.0     59.9\r
2883    720x400        85.0\r
2884    640x400        85.1\r
2885    640x350        85.1</tt></pre>\r
2886 </div></div>\r
2887 <div class="paragraph"><p>Several things are important here: You can see that <tt>LVDS1</tt> is connected (of\r
2888 course, it is the internal flat panel) but <tt>VGA1</tt> is not. If you have a monitor\r
2889 connected to one of the ports but xrandr still says "disconnected", you should\r
2890 check your cable, monitor or graphics driver.</p></div>\r
2891 <div class="paragraph"><p>The maximum resolution you can see at the end of the first line is the maximum\r
2892 combined resolution of your monitors. By default, it is usually too low and has\r
2893 to be increased by editing <tt>/etc/X11/xorg.conf</tt>.</p></div>\r
2894 <div class="paragraph"><p>So, say you connected VGA1 and want to use it as an additional screen:</p></div>\r
2895 <div class="listingblock">\r
2896 <div class="content">\r
2897 <pre><tt>xrandr --output VGA1 --auto --left-of LVDS1</tt></pre>\r
2898 </div></div>\r
2899 <div class="paragraph"><p>This command makes xrandr try to find the native resolution of the device\r
2900 connected to <tt>VGA1</tt> and configures it to the left of your internal flat panel.\r
2901 When running "xrandr" again, the output looks like this:</p></div>\r
2902 <div class="listingblock">\r
2903 <div class="content">\r
2904 <pre><tt>$ xrandr\r
2905 Screen 0: minimum 320 x 200, current 2560 x 1024, maximum 8192 x 8192\r
2906 VGA1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm\r
2907    1280x1024      60.0*+   75.0\r
2908    1280x960       60.0\r
2909    1152x864       75.0\r
2910    1024x768       75.1     70.1     60.0\r
2911    832x624        74.6\r
2912    800x600        72.2     75.0     60.3     56.2\r
2913    640x480        72.8     75.0     66.7     60.0\r
2914    720x400        70.1\r
2915 LVDS1 connected 1280x800+1280+0 (normal left inverted right x axis y axis) 261mm x 163mm\r
2916    1280x800       60.0*+   50.0\r
2917    1024x768       85.0     75.0     70.1     60.0\r
2918    832x624        74.6\r
2919    800x600        85.1     72.2     75.0     60.3     56.2\r
2920    640x480        85.0     72.8     75.0     59.9\r
2921    720x400        85.0\r
2922    640x400        85.1\r
2923    640x350        85.1</tt></pre>\r
2924 </div></div>\r
2925 <div class="paragraph"><p>Please note that i3 uses exactly the same API as xrandr does, so it will see\r
2926 only what you can see in xrandr.</p></div>\r
2927 <div class="paragraph"><p>See also <a href="#presentations">[presentations]</a> for more examples of multi-monitor setups.</p></div>\r
2928 </div>\r
2929 <div class="sect2">\r
2930 <h3 id="_interesting_configuration_for_multi_monitor_environments">9.2. Interesting configuration for multi-monitor environments</h3>\r
2931 <div class="paragraph"><p>There are several things to configure in i3 which may be interesting if you\r
2932 have more than one monitor:</p></div>\r
2933 <div class="olist arabic"><ol class="arabic">\r
2934 <li>\r
2935 <p>\r
2936 You can specify which workspace should be put on which screen. This\r
2937    allows you to have a different set of workspaces when starting than just\r
2938    1 for the first monitor, 2 for the second and so on. See\r
2939    <a href="#workspace_screen">[workspace_screen]</a>.\r
2940 </p>\r
2941 </li>\r
2942 <li>\r
2943 <p>\r
2944 If you want some applications to generally open on the bigger screen\r
2945    (MPlayer, Firefox, …), you can assign them to a specific workspace, see\r
2946    <a href="#assign_workspace">[assign_workspace]</a>.\r
2947 </p>\r
2948 </li>\r
2949 <li>\r
2950 <p>\r
2951 If you have many workspaces on many monitors, it might get hard to keep\r
2952    track of which window you put where. Thus, you can use vim-like marks to\r
2953    quickly switch between windows. See <a href="#vim_like_marks">[vim_like_marks]</a>.\r
2954 </p>\r
2955 </li>\r
2956 <li>\r
2957 <p>\r
2958 For information on how to move existing workspaces between monitors,\r
2959    see <a href="#move_to_outputs">[move_to_outputs]</a>.\r
2960 </p>\r
2961 </li>\r
2962 </ol></div>\r
2963 </div>\r
2964 </div>\r
2965 </div>\r
2966 <div class="sect1">\r
2967 <h2 id="_i3_and_the_rest_of_your_software_world">10. i3 and the rest of your software world</h2>\r
2968 <div class="sectionbody">\r
2969 <div class="sect2">\r
2970 <h3 id="_displaying_a_status_line">10.1. Displaying a status line</h3>\r
2971 <div class="paragraph"><p>A very common thing amongst users of exotic window managers is a status line at\r
2972 some corner of the screen. It is an often superior replacement to the widget\r
2973 approach you have in the task bar of a traditional desktop environment.</p></div>\r
2974 <div class="paragraph"><p>If you don’t already have your favorite way of generating such a status line\r
2975 (self-written scripts, conky, …), then i3status is the recommended tool for\r
2976 this task. It was written in C with the goal of using as few syscalls as\r
2977 possible to reduce the time your CPU is woken up from sleep states. Because\r
2978 i3status only spits out text, you need to combine it with some other tool, like\r
2979 i3bar. See <a href="#status_command">[status_command]</a> for how to display i3status in i3bar.</p></div>\r
2980 <div class="paragraph"><p>Regardless of which application you use to display the status line, you\r
2981 want to make sure that it registers as a dock window using EWMH hints. i3 will\r
2982 position the window either at the top or at the bottom of the screen, depending\r
2983 on which hint the application sets. With i3bar, you can configure its position,\r
2984 see <a href="#i3bar_position">[i3bar_position]</a>.</p></div>\r
2985 </div>\r
2986 <div class="sect2">\r
2987 <h3 id="presentations">10.2. Giving presentations (multi-monitor)</h3>\r
2988 <div class="paragraph"><p>When giving a presentation, you typically want the audience to see what you see\r
2989 on your screen and then go through a series of slides (if the presentation is\r
2990 simple). For more complex presentations, you might want to have some notes\r
2991 which only you can see on your screen, while the audience can only see the\r
2992 slides.</p></div>\r
2993 <div class="sect3">\r
2994 <h4 id="_case_1_everybody_gets_the_same_output">10.2.1. Case 1: everybody gets the same output</h4>\r
2995 <div class="paragraph"><p>This is the simple case. You connect your computer to the video projector,\r
2996 turn on both (computer and video projector) and configure your X server to\r
2997 clone the internal flat panel of your computer to the video output:</p></div>\r
2998 <div class="listingblock">\r
2999 <div class="content">\r
3000 <pre><tt>xrandr --output VGA1 --mode 1024x768 --same-as LVDS1</tt></pre>\r
3001 </div></div>\r
3002 <div class="paragraph"><p>i3 will then use the lowest common subset of screen resolutions, the rest of\r
3003 your screen will be left untouched (it will show the X background). So, in\r
3004 our example, this would be 1024x768 (my notebook has 1280x800).</p></div>\r
3005 </div>\r
3006 <div class="sect3">\r
3007 <h4 id="_case_2_you_can_see_more_than_your_audience">10.2.2. Case 2: you can see more than your audience</h4>\r
3008 <div class="paragraph"><p>This case is a bit harder. First of all, you should configure the VGA output\r
3009 somewhere near your internal flat panel, say right of it:</p></div>\r
3010 <div class="listingblock">\r
3011 <div class="content">\r
3012 <pre><tt>xrandr --output VGA1 --mode 1024x768 --right-of LVDS1</tt></pre>\r
3013 </div></div>\r
3014 <div class="paragraph"><p>Now, i3 will put a new workspace (depending on your settings) on the new screen\r
3015 and you are in multi-monitor mode (see <a href="#multi_monitor">[multi_monitor]</a>).</p></div>\r
3016 <div class="paragraph"><p>Because i3 is not a compositing window manager, there is no ability to\r
3017 display a window on two screens at the same time. Instead, your presentation\r
3018 software needs to do this job (that is, open a window on each screen).</p></div>\r
3019 </div>\r
3020 </div>\r
3021 </div>\r
3022 </div>\r
3023 </div>\r
3024 <div id="footnotes"><hr /></div>\r
3025 <div id="footer" lang="de">\r
3026 © 2009-2011 Michael Stapelberg, <a href="/impress.html">Impressum</a>\r
3027 </div>\r
3028 </body>\r
3029 </html>\r