]> git.sur5r.net Git - i3/i3/blob - docs/userguide
Make the initial mention of 'split h/v' a little easier to understand.
[i3/i3] / docs / userguide
1 i3 User’s Guide
2 ===============
3 Michael Stapelberg <michael@i3wm.org>
4 August 2012
5
6 This document contains all the information you need to configure and use the i3
7 window manager. If it does not, please contact us on IRC (preferred) or post your
8 question(s) on the mailing list.
9
10 == Default keybindings
11
12 For the "too long; didn’t read" people, here is an overview of the default
13 keybindings (click to see the full size image):
14
15 *Keys to use with mod (alt):*
16
17 image:keyboard-layer1.png["Keys to use with mod (alt)",width=600,link="keyboard-layer1.png"]
18
19 *Keys to use with Shift+mod:*
20
21 image:keyboard-layer2.png["Keys to use with Shift+mod",width=600,link="keyboard-layer2.png"]
22
23 The red keys are the modifiers you need to press (by default), the blue keys
24 are your homerow.
25
26 == Using i3
27
28 Throughout this guide, the keyword +mod+ will be used to refer to the
29 configured modifier. This is the alt key (Mod1) by default, with windows (Mod4)
30 being a popular alternative.
31
32 === Opening terminals and moving around
33
34 One very basic operation is opening a new terminal. By default, the keybinding
35 for this is mod+Enter, that is Alt+Enter in the default configuration. By
36 pressing mod+Enter, a new terminal will be opened.  It will fill the whole
37 space available on your screen.
38
39 image:single_terminal.png[Single terminal]
40
41 If you now open another terminal, i3 will place it next to the current one,
42 splitting the screen size in half. Depending on your monitor, i3 will put the
43 created window beside the existing window (on wide displays) or below the
44 existing window (rotated displays).
45
46 image:two_terminals.png[Two terminals]
47
48 To move the focus between the two terminals, you can use the direction keys
49 which you may know from the editor +vi+. However, in i3, your homerow is used
50 for these keys (in +vi+, the keys are shifted to the left by one for
51 compatibility with most keyboard layouts). Therefore, +mod+J+ is left, +mod+K+
52 is down, +mod+L+ is up and `mod+;` is right. So, to switch between the
53 terminals, use +mod+K+ or +mod+L+. Of course, you can also use the arrow keys.
54
55 At the moment, your workspace is split (it contains two terminals) in a
56 specific direction (horizontal by default). Every window can be split
57 horizontally or vertically again, just like the workspace. The terminology is
58 "window" for a container that actually contains an X11 window (like a terminal
59 or browser) and "split container" for containers that consist of one or more
60 windows.
61
62 TODO: picture of the tree
63
64 To split a window vertically, press +mod+v+ before you create the new window.
65 To split it horizontally, press +mod+h+.
66
67 === Changing the container layout
68
69 A split container can have one of the following layouts:
70
71 splith/splitv::
72 Windows are sized so that every window gets an equal amount of space in the
73 container. splith distributes the windows horizontally (windows are right next
74 to each other), splitv distributes them vertically (windows are on top of each
75 other).
76 stacking::
77 Only the focused window in the container is displayed. You get a list of
78 windows at the top of the container.
79 tabbed::
80 The same principle as +stacking+, but the list of windows at the top is only
81 a single line which is vertically split.
82
83 To switch modes, press +mod+e+ for splith/splitv (it toggles), +mod+s+ for
84 stacking and +mod+w+ for tabbed.
85
86 image:modes.png[Container modes]
87
88 === Toggling fullscreen mode for a window
89
90 To display a window in fullscreen mode or to go out of fullscreen mode again,
91 press +mod+f+.
92
93 There is also a global fullscreen mode in i3 in which the client will span all
94 available outputs (the command is +fullscreen global+).
95
96 === Opening other applications
97
98 Aside from opening applications from a terminal, you can also use the handy
99 +dmenu+ which is opened by pressing +mod+d+ by default. Just type the name
100 (or a part of it) of the application which you want to open. The corresponding
101 application has to be in your +$PATH+ for this to work.
102
103 Additionally, if you have applications you open very frequently, you can
104 create a keybinding for starting the application directly. See the section
105 <<configuring>> for details.
106
107 === Closing windows
108
109 If an application does not provide a mechanism for closing (most applications
110 provide a menu, the escape key or a shortcut like +Control+W+ to close), you
111 can press +mod+Shift+q+ to kill a window. For applications which support
112 the WM_DELETE protocol, this will correctly close the application (saving
113 any modifications or doing other cleanup). If the application doesn’t support
114 the WM_DELETE protocol your X server will kill the window and the behaviour
115 depends on the application.
116
117 === Using workspaces
118
119 Workspaces are an easy way to group a set of windows. By default, you are on
120 the first workspace, as the bar on the bottom left indicates. To switch to
121 another workspace, press +mod+num+ where +num+ is the number of the workspace
122 you want to use. If the workspace does not exist yet, it will be created.
123
124 A common paradigm is to put the web browser on one workspace, communication
125 applications (+mutt+, +irssi+, ...) on another one, and the ones with which you
126 work, on the third one. Of course, there is no need to follow this approach.
127
128 If you have multiple screens, a workspace will be created on each screen at
129 startup. If you open a new workspace, it will be bound to the screen you
130 created it on.  When you switch to a workspace on another screen, i3 will set
131 focus to that screen.
132
133 === Moving windows to workspaces
134
135 To move a window to another workspace, simply press +mod+Shift+num+ where
136 +num+ is (like when switching workspaces) the number of the target workspace.
137 Similarly to switching workspaces, the target workspace will be created if
138 it does not yet exist.
139
140 === Resizing
141
142 The easiest way to resize a container is by using the mouse: Grab the border
143 and move it to the wanted size.
144
145 See <<resizingconfig>> for how to configure i3 to be able to resize
146 columns/rows with your keyboard.
147
148 === Restarting i3 inplace
149
150 To restart i3 inplace (and thus get into a clean state if there is a bug, or
151 to upgrade to a newer version of i3) you can use +mod+Shift+r+.
152
153 === Exiting i3
154
155 To cleanly exit i3 without killing your X server, you can use +mod+Shift+e+.
156
157 === Floating
158
159 Floating mode is the opposite of tiling mode. The position and size of a window
160 are not managed by i3, but by you. Using this mode violates the tiling
161 paradigm but can be useful for some corner cases like "Save as" dialog
162 windows, or toolbar windows (GIMP or similar). Those windows usually set the
163 appropriate hint and are opened in floating mode by default.
164
165 You can toggle floating mode for a window by pressing +mod+Shift+Space+. By
166 dragging the window’s titlebar with your mouse you can move the window
167 around. By grabbing the borders and moving them you can resize the window. You
168 can also do that by using the <<floating_modifier>>.
169
170 For resizing floating windows with your keyboard, see <<resizingconfig>>.
171
172 Floating windows are always on top of tiling windows.
173
174 == Tree
175
176 i3 stores all information about the X11 outputs, workspaces and layout of the
177 windows on them in a tree. The root node is the X11 root window, followed by
178 the X11 outputs, then dock areas and a content container, then workspaces and
179 finally the windows themselves. In previous versions of i3 we had multiple lists
180 (of outputs, workspaces) and a table for each workspace. That approach turned
181 out to be complicated to use (snapping), understand and implement.
182
183 === The tree consists of Containers
184
185 The building blocks of our tree are so called +Containers+. A +Container+ can
186 host a window (meaning an X11 window, one that you can actually see and use,
187 like a browser). Alternatively, it could contain one or more +Containers+. A
188 simple example is the workspace: When you start i3 with a single monitor, a
189 single workspace and you open two terminal windows, you will end up with a tree
190 like this:
191
192 image::tree-layout2.png["layout2",float="right"]
193 image::tree-shot4.png["shot4",title="Two terminals on standard workspace"]
194
195 === Orientation and Split Containers
196
197 [[OrientationSplit]]
198
199 It is only natural to use so-called +Split Containers+ in order to build a
200 layout when using a tree as data structure. In i3, every +Container+ has an
201 orientation (horizontal, vertical or unspecified) and the orientation depends
202 on the layout the container is in (vertical for splitv and stacking, horizontal
203 for splith and tabbed). So, in our example with the workspace, the default
204 layout of the workspace +Container+ is splith (most monitors are widescreen
205 nowadays). If you change the layout to splitv (+mod+l+ in the default config)
206 and *then* open two terminals, i3 will configure your windows like this:
207
208 image::tree-shot2.png["shot2",title="Vertical Workspace Orientation"]
209
210 An interesting new feature of i3 since version 4 is the ability to split anything:
211 Let’s assume you have two terminals on a workspace (with splith layout, that is
212 horizontal orientation), focus is on the right terminal. Now you want to open
213 another terminal window below the current one. If you would just open a new
214 terminal window, it would show up to the right due to the splith layout.
215 Instead, press +mod+v+ to split the container with the splitv layout (to
216 open a +Horizontal Split Container+, use +mod+h+). Now you can open a new
217 terminal and it will open below the current one:
218
219 image::tree-layout1.png["Layout",float="right"]
220 image::tree-shot1.png["shot",title="Vertical Split Container"]
221
222 unfloat::[]
223
224 You probably guessed it already: There is no limit on how deep your hierarchy
225 of splits can be.
226
227 === Focus parent
228
229 Let’s stay with our example from above. We have a terminal on the left and two
230 vertically split terminals on the right, focus is on the bottom right one. When
231 you open a new terminal, it will open below the current one.
232
233 So, how can you open a new terminal window to the *right* of the current one?
234 The solution is to use +focus parent+, which will focus the +Parent Container+ of
235 the current +Container+. In this case, you would focus the +Vertical Split
236 Container+ which is *inside* the horizontally oriented workspace. Thus, now new
237 windows will be opened to the right of the +Vertical Split Container+:
238
239 image::tree-shot3.png["shot3",title="Focus parent, then open new terminal"]
240
241 === Implicit containers
242
243 In some cases, i3 needs to implicitly create a container to fulfill your
244 command.
245
246 One example is the following scenario: You start i3 with a single monitor and a
247 single workspace on which you open three terminal windows. All these terminal
248 windows are directly attached to one node inside i3’s layout tree, the
249 workspace node. By default, the workspace node’s orientation is +horizontal+.
250
251 Now you move one of these terminals down (+mod+k+ by default). The workspace
252 node’s orientation will be changed to +vertical+. The terminal window you moved
253 down is directly attached to the workspace and appears on the bottom of the
254 screen. A new (horizontal) container was created to accomodate the other two
255 terminal windows. You will notice this when switching to tabbed mode (for
256 example). You would end up having one tab called "another container" and the
257 other one being the terminal window you moved down.
258
259 [[configuring]]
260 == Configuring i3
261
262 This is where the real fun begins ;-). Most things are very dependant on your
263 ideal working environment so we can’t make reasonable defaults for them.
264
265 While not using a programming language for the configuration, i3 stays
266 quite flexible in regards to the things you usually want your window manager
267 to do.
268
269 For example, you can configure bindings to jump to specific windows,
270 you can set specific applications to start on specific workspaces, you can
271 automatically start applications, you can change the colors of i3, and you
272 can bind your keys to do useful things.
273
274 To change the configuration of i3, copy +/etc/i3/config+ to +\~/.i3/config+
275 (or +~/.config/i3/config+ if you like the XDG directory scheme) and edit it
276 with a text editor.
277
278 On first start (and on all following starts, unless you have a configuration
279 file), i3 will offer you to create a configuration file. You can tell the
280 wizard to use either Alt (Mod1) or Windows (Mod4) as modifier in the config
281 file. Also, the created config file will use the key symbols of your current
282 keyboard layout. To start the wizard, use the command +i3-config-wizard+.
283 Please note that you must not have +~/.i3/config+, otherwise the wizard will
284 exit.
285
286 === Comments
287
288 It is possible and recommended to use comments in your configuration file to
289 properly document your setup for later reference. Comments are started with
290 a # and can only be used at the beginning of a line:
291
292 *Examples*:
293 -------------------
294 # This is a comment
295 -------------------
296
297 [[fonts]]
298
299 === Fonts
300
301 i3 has support for both X core fonts and FreeType fonts (through Pango) to
302 render window titles.
303
304 To generate an X core font description, you can use +xfontsel(1)+. To see
305 special characters (Unicode), you need to use a font which supports the
306 ISO-10646 encoding.
307
308 A FreeType font description is composed by a font family, a style, a weight,
309 a variant, a stretch and a size.
310 FreeType fonts support right-to-left rendering and contain often more
311 Unicode glyphs than X core fonts.
312
313 If i3 cannot open the configured font, it will output an error in the logfile
314 and fall back to a working font.
315
316 *Syntax*:
317 ------------------------------
318 font <X core font description>
319 font xft:<a FreeType font description>
320 ------------------------------
321
322 *Examples*:
323 --------------------------------------------------------------
324 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
325 font xft:DejaVu Sans Mono 10
326 --------------------------------------------------------------
327
328 [[keybindings]]
329
330 === Keyboard bindings
331
332 A keyboard binding makes i3 execute a command (see below) upon pressing a
333 specific key. i3 allows you to bind either on keycodes or on keysyms (you can
334 also mix your bindings, though i3 will not protect you from overlapping ones).
335
336 * A keysym (key symbol) is a description for a specific symbol, like "a"
337   or "b", but also more strange ones like "underscore" instead of "_". These
338   are the ones you use in Xmodmap to remap your keys. To get the current
339   mapping of your keys, use +xmodmap -pke+. To interactively enter a key and
340   see what keysym it is configured to, use +xev+.
341
342 * Keycodes do not need to have a symbol assigned (handy for custom vendor
343   hotkeys on some notebooks) and they will not change their meaning as you
344   switch to a different keyboard layout (when using +xmodmap+).
345
346 My recommendation is: If you often switch keyboard layouts but you want to keep
347 your bindings in the same physical location on the keyboard, use keycodes.
348 If you don’t switch layouts, and want a clean and simple config file, use
349 keysyms.
350
351 *Syntax*:
352 ----------------------------------
353 bindsym [Modifiers+]keysym command
354 bindcode [Modifiers+]keycode command
355 ----------------------------------
356
357 *Examples*:
358 --------------------------------
359 # Fullscreen
360 bindsym mod+f fullscreen
361
362 # Restart
363 bindsym mod+Shift+r restart
364
365 # Notebook-specific hotkeys
366 bindcode 214 exec /home/michael/toggle_beamer.sh
367 --------------------------------
368
369 Available Modifiers:
370
371 Mod1-Mod5, Shift, Control::
372 Standard modifiers, see +xmodmap(1)+
373
374 Mode_switch::
375 Unlike other window managers, i3 can use Mode_switch as a modifier. This allows
376 you to remap capslock (for example) to Mode_switch and use it for both: typing
377 umlauts or special characters 'and' having some comfortably reachable key
378 bindings. For example, when typing, capslock+1 or capslock+2 for switching
379 workspaces is totally convenient. Try it :-).
380
381 [[floating_modifier]]
382
383 === The floating modifier
384
385 To move floating windows with your mouse, you can either grab their titlebar
386 or configure the so called floating modifier which you can then press and
387 click anywhere in the window itself to move it. The most common setup is to
388 use the same key you use for managing windows (Mod1 for example). Then
389 you can press Mod1, click into a window using your left mouse button, and drag
390 it to the position you want.
391
392 When holding the floating modifier, you can resize a floating window by
393 pressing the right mouse button on it and moving around while holding it. If
394 you hold the shift button as well, the resize will be proportional (the aspect
395 ratio will be preserved).
396
397 *Syntax*:
398 --------------------------------
399 floating_modifier <Modifiers>
400 --------------------------------
401
402 *Example*:
403 --------------------------------
404 floating_modifier Mod1
405 --------------------------------
406
407 === Constraining floating window size
408
409 The maximum and minimum dimensions of floating windows can be specified. If
410 either dimension of +floating_maximum_size+ is specified as -1, that dimension
411 will be unconstrained with respect to its maximum value. If either dimension of
412 +floating_maximum_size+ is undefined, or specified as 0, i3 will use a default
413 value to constrain the maximum size. +floating_minimum_size+ is treated in a
414 manner analogous to +floating_maximum_size+.
415
416 *Syntax*:
417 ----------------------------------------
418 floating_minimum_size <width> x <height>
419 floating_maximum_size <width> x <height>
420 ----------------------------------------
421
422 *Example*:
423 --------------------------------------
424 floating_minimum_size 75 x 50
425 floating_maximum_size -1 x -1
426 --------------------------------------
427
428 === Orientation for new workspaces
429
430 New workspaces get a reasonable default orientation: Wide-screen monitors
431 (anything wider than high) get horizontal orientation, rotated monitors
432 (anything higher than wide) get vertical orientation.
433
434 With the +default_orientation+ configuration directive, you can override that
435 behaviour.
436
437 *Syntax*:
438 ----------------------------------------------
439 default_orientation <horizontal|vertical|auto>
440 ----------------------------------------------
441
442 *Example*:
443 ----------------------------
444 default_orientation vertical
445 ----------------------------
446
447 === Layout mode for new containers
448
449 This option determines in which mode new containers on workspace level will
450 start.
451 ///////////////////////////////
452 See also <<stack-limit>>.
453 //////////////////////////////
454
455 *Syntax*:
456 ---------------------------------------------
457 workspace_layout <default|stacking|tabbed>
458 ---------------------------------------------
459 /////////////////////////////////////////////
460 new_container stack-limit <cols|rows> <value>
461 /////////////////////////////////////////////
462
463 *Example*:
464 ---------------------
465 workspace_layout tabbed
466 ---------------------
467
468 === Border style for new windows
469
470 This option determines which border style new windows will have. The default is
471 "normal".
472
473 *Syntax*:
474 ---------------------------------------------
475 new_window <normal|1pixel|none>
476 ---------------------------------------------
477
478 *Example*:
479 ---------------------
480 new_window 1pixel
481 ---------------------
482
483 === Hiding vertical borders
484
485 You can hide vertical borders adjacent to the screen edges using
486 +hide_edge_borders+. This is useful if you are using scrollbars, or do not want
487 to waste even two pixels in displayspace. Default is none.
488
489 *Syntax*:
490 ----------------------------
491 hide_edge_borders <none|vertical|horizontal|both>
492 ----------------------------
493
494 *Example*:
495 ----------------------
496 hide_edge_borders vertical
497 ----------------------
498
499 === Arbitrary commands for specific windows (for_window)
500
501 With the +for_window+ command, you can let i3 execute any command when it
502 encounters a specific window. This can be used to set windows to floating or to
503 change their border style, for example.
504
505 *Syntax*:
506 -----------------------------
507 for_window <criteria> command
508 -----------------------------
509
510 *Examples*:
511 ------------------------------------------------
512 # enable floating mode for all XTerm windows
513 for_window [class="XTerm"] floating enable
514
515 # Make all urxvts use a 1-pixel border:
516 for_window [class="urxvt"] border 1pixel
517
518 # A less useful, but rather funny example:
519 # makes the window floating as soon as I change
520 # directory to ~/work
521 for_window [title="x200: ~/work"] floating enable
522 ------------------------------------------------
523
524 The valid criteria are the same as those for commands, see <<command_criteria>>.
525
526 === Variables
527
528 As you learned in the section about keyboard bindings, you will have
529 to configure lots of bindings containing modifier keys. If you want to save
530 yourself some typing and be able to change the modifier you use later,
531 variables can be handy.
532
533 *Syntax*:
534 --------------
535 set $name value
536 --------------
537
538 *Example*:
539 ------------------------
540 set $m Mod1
541 bindsym $m+Shift+r restart
542 ------------------------
543
544 Variables are directly replaced in the file when parsing. There is no fancy
545 handling and there are absolutely no plans to change this. If you need a more
546 dynamic configuration you should create a little script which generates a
547 configuration file and run it before starting i3 (for example in your
548 +~/.xsession+ file).
549
550 === Automatically putting clients on specific workspaces
551
552 [[assign_workspace]]
553
554 To automatically make a specific window show up on a specific workspace, you
555 can use an *assignment*. You can match windows by using any criteria,
556 see <<command_criteria>>. It is recommended that you match on window classes
557 (and instances, when appropriate) instead of window titles whenever possible
558 because some applications first create their window, and then worry about
559 setting the correct title. Firefox with Vimperator comes to mind. The window
560 starts up being named Firefox, and only when Vimperator is loaded does the
561 title change. As i3 will get the title as soon as the application maps the
562 window (mapping means actually displaying it on the screen), you’d need to have
563 to match on 'Firefox' in this case.
564
565 *Syntax*:
566 ------------------------------------------------------------
567 assign <criteria> [→] workspace
568 ------------------------------------------------------------
569
570 *Examples*:
571 ----------------------
572 # Assign URxvt terminals to workspace 2
573 assign [class="URxvt"] 2
574
575 # Same thing, but more precise (exact match instead of substring)
576 assign [class="^URxvt$"] 2
577
578 # Same thing, but with a beautiful arrow :)
579 assign [class="^URxvt$"] → 2
580
581 # Assignment to a named workspace
582 assign [class="^URxvt$"] → work
583
584 # Start urxvt -name irssi
585 assign [class="^URxvt$" instance="^irssi$"] → 3
586 ----------------------
587
588 Note that the arrow is not required, it just looks good :-). If you decide to
589 use it, it has to be a UTF-8 encoded arrow, not `->` or something like that.
590
591 To get the class and instance, you can use +xprop+. After clicking on the
592 window, you will see the following output:
593
594 *xprop*:
595 -----------------------------------
596 WM_CLASS(STRING) = "irssi", "URxvt"
597 -----------------------------------
598
599 The first part of the WM_CLASS is the instance ("irssi" in this example), the
600 second part is the class ("URxvt" in this example).
601
602 Should you have any problems with assignments, make sure to check the i3
603 logfile first (see http://i3wm.org/docs/debugging.html). It includes more
604 details about the matching process and the window’s actual class, instance and
605 title when starting up.
606
607 === Automatically starting applications on i3 startup
608
609 By using the +exec+ keyword outside a keybinding, you can configure
610 which commands will be performed by i3 on initial startup. +exec+
611 commands will not run when restarting i3, if you need a command to run
612 also when restarting i3 you should use the +exec_always+
613 keyword. These commands will be run in order.
614
615 *Syntax*:
616 -------------------
617 exec [--no-startup-id] command
618 exec_always [--no-startup-id] command
619 -------------------
620
621 *Examples*:
622 --------------------------------
623 exec chromium
624 exec_always ~/my_script.sh
625
626 # Execute the terminal emulator urxvt, which is not yet startup-notification aware.
627 exec --no-startup-id urxvt
628 --------------------------------
629
630 The flag --no-startup-id is explained in <<exec>>.
631
632 [[workspace_screen]]
633
634 === Automatically putting workspaces on specific screens
635
636 If you assign clients to workspaces, it might be handy to put the
637 workspaces on specific screens. Also, the assignment of workspaces to screens
638 will determine which workspace i3 uses for a new screen when adding screens
639 or when starting (e.g., by default it will use 1 for the first screen, 2 for
640 the second screen and so on).
641
642 *Syntax*:
643 ----------------------------------
644 workspace <workspace> output <output>
645 ----------------------------------
646
647 The 'output' is the name of the RandR output you attach your screen to. On a
648 laptop, you might have VGA1 and LVDS1 as output names. You can see the
649 available outputs by running +xrandr --current+.
650
651 If you use named workspaces, they must be quoted:
652
653 *Examples*:
654 ---------------------------
655 workspace 1 output LVDS1
656 workspace 5 output VGA1
657 workspace "2: vim" output VGA1
658 ---------------------------
659
660 === Changing colors
661
662 You can change all colors which i3 uses to draw the window decorations.
663
664 *Syntax*:
665 --------------------------------------------
666 colorclass border background text indicator
667 --------------------------------------------
668
669 Where colorclass can be one of:
670
671 client.focused::
672         A client which currently has the focus.
673 client.focused_inactive::
674         A client which is the focused one of its container, but it does not have
675         the focus at the moment.
676 client.unfocused::
677         A client which is not the focused one of its container.
678 client.urgent::
679         A client which has its urgency hint activated.
680
681 You can also specify the color to be used to paint the background of the client
682 windows. This color will be used to paint the window on top of which the client
683 will be rendered.
684
685 *Syntax*:
686 -----------------------
687 client.background color
688 -----------------------
689
690 Only clients that do not cover the whole area of this window expose the color
691 used to paint it. If you use a color other than black for your terminals, you
692 most likely want to set the client background color to the same color as your
693 terminal program's background color to avoid black gaps between the rendered
694 area of the terminal and the i3 border.
695
696 Colors are in HTML hex format (#rrggbb), see the following example:
697
698 *Examples (default colors)*:
699 ---------------------------------------------------------
700 # class                 border  backgr. text    indicator
701 client.focused          #4c7899 #285577 #ffffff #2e9ef4
702 client.focused_inactive #333333 #5f676a #ffffff #484e50
703 client.unfocused        #333333 #222222 #888888 #292d2e
704 client.urgent           #2f343a #900000 #ffffff #900000
705 ---------------------------------------------------------
706
707 Note that for the window decorations, the color around the child window is the
708 background color, and the border color is only the two thin lines at the top of
709 the window.
710
711 The indicator color is used for indicating where a new window will be opened.
712 For horizontal split containers, the right border will be painted in indicator
713 color, for vertical split containers, the bottom border. This only applies to
714 single windows within a split container, which are otherwise indistinguishable
715 from single windows outside of a split container.
716
717 === Interprocess communication
718
719 i3 uses unix sockets to provide an IPC interface. This allows third-party
720 programs to get information from i3, such as the current workspaces
721 (to display a workspace bar), and to control i3.
722
723 The IPC socket is enabled by default and will be created in
724 +/tmp/i3-%u.XXXXXX/ipc-socket.%p+ where +%u+ is your UNIX username, +%p+ is
725 the PID of i3 and XXXXXX is a string of random characters from the portable
726 filename character set (see mkdtemp(3)).
727
728 You can override the default path through the environment-variable +I3SOCK+ or
729 by specifying the +ipc-socket+ directive. This is discouraged, though, since i3
730 does the right thing by default. If you decide to change it, it is strongly
731 recommended to set this to a location in your home directory so that no other
732 user can create that directory.
733
734 *Examples*:
735 ----------------------------
736 ipc-socket ~/.i3/i3-ipc.sock
737 ----------------------------
738
739 You can then use the +i3-msg+ application to perform any command listed in
740 the next section.
741
742 === Focus follows mouse
743
744 By default, window focus follows your mouse movements. However, if you have a
745 setup where your mouse usually is in your way (like a touchpad on your laptop
746 which you do not want to disable completely), you might want to disable 'focus
747 follows mouse' and control focus only by using your keyboard.  The mouse will
748 still be useful inside the currently active window (for example to click on
749 links in your browser window).
750
751 *Syntax*:
752 ----------------------------
753 focus_follows_mouse <yes|no>
754 ----------------------------
755
756 *Example*:
757 ----------------------
758 focus_follows_mouse no
759 ----------------------
760
761 === Popups during fullscreen mode
762
763 When you are in fullscreen mode, some applications still open popup windows
764 (take Xpdf for example). This is because these applications may not be aware
765 that they are in fullscreen mode (they do not check the corresponding hint).
766 There are two things which are possible to do in this situation:
767
768 1. Just ignore the popup (don’t map it). This won’t interrupt you while you are
769    in fullscreen. However, some apps might react badly to this (deadlock until
770    you go out of fullscreen).
771 2. Leave fullscreen mode. This is the default.
772
773 *Syntax*:
774 -------------------------------------------------
775 popup_during_fullscreen <ignore|leave_fullscreen>
776 -------------------------------------------------
777
778 *Example*:
779 ------------------------------
780 popup_during_fullscreen ignore
781 ------------------------------
782
783 === Focus wrapping
784
785 When being in a tabbed or stacked container, the first container will be
786 focused when you use +focus down+ on the last container -- the focus wraps. If
787 however there is another stacked/tabbed container in that direction, focus will
788 be set on that container. This is the default behaviour so you can navigate to
789 all your windows without having to use +focus parent+.
790
791 If you want the focus to *always* wrap and you are aware of using +focus
792 parent+ to switch to different containers, you can use the
793 +force_focus_wrapping+ configuration directive. After enabling it, the focus
794 will always wrap.
795
796 *Syntax*:
797 -----------------------------
798 force_focus_wrapping <yes|no>
799 -----------------------------
800
801 *Example*:
802 ------------------------
803 force_focus_wrapping yes
804 ------------------------
805
806 === Forcing Xinerama
807
808 As explained in-depth in <http://i3wm.org/docs/multi-monitor.html>, some X11
809 video drivers (especially the nVidia binary driver) only provide support for
810 Xinerama instead of RandR. In such a situation, i3 must be told to use the
811 inferior Xinerama API explicitly and therefore don’t provide support for
812 reconfiguring your screens on the fly (they are read only once on startup and
813 that’s it).
814
815 For people who do cannot modify their +~/.xsession+ to add the
816 +--force-xinerama+ commandline parameter, a configuration option is provided:
817
818 *Syntax*:
819 -----------------------
820 force_xinerama <yes|no>
821 -----------------------
822
823 *Example*:
824 ------------------
825 force_xinerama yes
826 ------------------
827
828 Also note that your output names are not descriptive (like +HDMI1+) when using
829 Xinerama, instead they are counted up, starting at 0: +xinerama-0+, +xinerama-1+, …
830
831 === Automatic back-and-forth when switching to the current workspace
832
833 This configuration directive enables automatic +workspace back_and_forth+ (see
834 <<back_and_forth>>) when switching to the workspace that is currently focused.
835
836 For instance: Assume you are on workspace "1: www" and switch to "2: IM" using
837 mod+2 because somebody sent you a message. You don’t need to remember where you
838 came from now, you can just press mod+2 again to switch back to "1: www".
839
840 *Syntax*:
841 --------------------------------------
842 workspace_auto_back_and_forth <yes|no>
843 --------------------------------------
844
845 *Example*:
846 ---------------------------------
847 workspace_auto_back_and_forth yes
848 ---------------------------------
849
850 == Configuring i3bar
851
852 The bar at the bottom of your monitor is drawn by a separate process called
853 i3bar. Having this part of "the i3 user interface" in a separate process has
854 several advantages:
855
856 1. It is a modular approach. If you don’t need a workspace bar at all, or if
857    you prefer a different one (dzen2, xmobar, maybe even gnome-panel?), you can
858    just remove the i3bar configuration and start your favorite bar instead.
859 2. It follows the UNIX philosophy of "Make each program do one thing well".
860    While i3 manages your windows well, i3bar is good at displaying a bar on
861    each monitor (unless you configure it otherwise).
862 3. It leads to two separate, clean codebases. If you want to understand i3, you
863    don’t need to bother with the details of i3bar and vice versa.
864
865 That said, i3bar is configured in the same configuration file as i3. This is
866 because it is tightly coupled with i3 (in contrary to i3lock or i3status which
867 are useful for people using other window managers). Therefore, it makes no
868 sense to use a different configuration place when we already have a good
869 configuration infrastructure in place.
870
871 Configuring your workspace bar starts with opening a +bar+ block. You can have
872 multiple bar blocks to use different settings for different outputs (monitors):
873
874 *Example*:
875 ---------------------------
876 bar {
877     status_command i3status
878 }
879 ---------------------------
880
881 === i3bar command
882
883 By default i3 will just pass +i3bar+ and let your shell handle the execution,
884 searching your +$PATH+ for a correct version.
885 If you have a different +i3bar+ somewhere or the binary is not in your +$PATH+ you can
886 tell i3 what to execute.
887
888 The specified command will be passed to +sh -c+, so you can use globbing and
889 have to have correct quoting etc.
890
891 *Syntax*:
892 ----------------------
893 i3bar_command command
894 ----------------------
895
896 *Example*:
897 -------------------------------------------------
898 bar {
899     i3bar_command /home/user/bin/i3bar
900 }
901 -------------------------------------------------
902
903 [[status_command]]
904 === Statusline command
905
906 i3bar can run a program and display every line of its +stdout+ output on the
907 right hand side of the bar. This is useful to display system information like
908 your current IP address, battery status or date/time.
909
910 The specified command will be passed to +sh -c+, so you can use globbing and
911 have to have correct quoting etc.
912
913 *Syntax*:
914 ----------------------
915 status_command command
916 ----------------------
917
918 *Example*:
919 -------------------------------------------------
920 bar {
921     status_command i3status --config ~/.i3status.conf
922 }
923 -------------------------------------------------
924
925 === Display mode
926
927 You can have i3bar either be visible permanently at one edge of the screen
928 (+dock+ mode) or make it show up when you press your modifier key (+hide+
929 mode). The modifier key can be configured using the +modifier+ option.
930
931 The hide mode maximizes screen space that can be used for actual windows. Also,
932 i3bar sends the +SIGSTOP+ and +SIGCONT+ signals to the statusline process to
933 save battery power.
934
935 The default is dock mode; in hide mode, the default modifier is Mod4 (usually
936 the windows key).
937
938 *Syntax*:
939 ----------------
940 mode <dock|hide>
941 modifier <Modifier>
942 ----------------
943
944 *Example*:
945 ----------------
946 bar {
947     mode hide
948     modifier Mod1
949 }
950 ----------------
951
952 Available modifiers are Mod1-Mod5, Shift, Control (see +xmodmap(1)+).
953
954 [[i3bar_position]]
955 === Position
956
957 This option determines in which edge of the screen i3bar should show up.
958
959 The default is bottom.
960
961 *Syntax*:
962 ---------------------
963 position <top|bottom>
964 ---------------------
965
966 *Example*:
967 ---------------------
968 bar {
969     position top
970 }
971 ---------------------
972
973 === Output(s)
974
975 You can restrict i3bar to one or more outputs (monitors). The default is to
976 handle all outputs. Restricting the outputs is useful for using different
977 options for different outputs by using multiple 'bar' blocks.
978
979 To make a particular i3bar instance handle multiple outputs, specify the output
980 directive multiple times.
981
982 *Syntax*:
983 ---------------
984 output <output>
985 ---------------
986
987 *Example*:
988 -------------------------------
989 # big monitor: everything
990 bar {
991     # The display is connected either via HDMI or via DisplayPort
992     output HDMI2
993     output DP2
994     status_command i3status
995 }
996
997 # laptop monitor: bright colors and i3status with less modules.
998 bar {
999     output LVDS1
1000     status_command i3status --config ~/.i3status-small.conf
1001     colors {
1002         background #000000
1003         statusline #ffffff
1004     }
1005 }
1006 -------------------------------
1007
1008 === Tray output
1009
1010 i3bar by default provides a system tray area where programs such as
1011 NetworkManager, VLC, Pidgin, etc. can place little icons.
1012
1013 You can configure on which output (monitor) the icons should be displayed or
1014 you can turn off the functionality entirely.
1015
1016 *Syntax*:
1017 -------------------------
1018 tray_output <none|primary|output>
1019 -------------------------
1020
1021 *Example*:
1022 -------------------------
1023 # disable system tray
1024 bar {
1025     tray_output none
1026 }
1027
1028 # show tray icons on the primary monitor
1029 tray_output primary
1030
1031 # show tray icons on the big monitor
1032 bar {
1033     tray_output HDMI2
1034 }
1035 -------------------------
1036
1037 Note that you might not have a primary output configured yet. To do so, run:
1038 -------------------------
1039 xrandr --output <output> --primary
1040 -------------------------
1041
1042 === Font
1043
1044 Specifies the font to be used in the bar. See <<fonts>>.
1045
1046 *Syntax*:
1047 ---------------------
1048 font <font>
1049 ---------------------
1050
1051 *Example*:
1052 --------------------------------------------------------------
1053 bar {
1054     font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
1055     font xft:DejaVu Sans Mono 10
1056 }
1057 --------------------------------------------------------------
1058
1059 === Workspace buttons
1060
1061 Specifies whether workspace buttons should be shown or not. This is useful if
1062 you want to display a statusline-only bar containing additional information.
1063
1064 The default is to show workspace buttons.
1065
1066 *Syntax*:
1067 --------------------------
1068 workspace_buttons <yes|no>
1069 --------------------------
1070
1071 *Example*:
1072 --------------------
1073 bar {
1074     workspace_buttons no
1075 }
1076 --------------------
1077
1078 === Colors
1079
1080 As with i3, colors are in HTML hex format (#rrggbb). The following colors can
1081 be configured at the moment:
1082
1083 background::
1084         Background color of the bar.
1085 statusline::
1086         Text color to be used for the statusline.
1087 focused_workspace::
1088         Border, background and text color for a workspace button when the workspace
1089         has focus.
1090 active_workspace::
1091         Border, background and text color for a workspace button when the workspace
1092         is active (visible) on some output, but the focus is on another one.
1093         You can only tell this apart from the focused workspace when you are
1094         using multiple monitors.
1095 inactive_workspace::
1096         Border, background and text color for a workspace button when the workspace
1097         does not have focus and is not active (visible) on any output. This
1098         will be the case for most workspaces.
1099 urgent_workspace::
1100         Border, background and text color for a workspace button when the workspace
1101         window with the urgency hint set.
1102
1103 *Syntax*:
1104 ----------------------------------------
1105 colors {
1106     background <color>
1107     statusline <color>
1108
1109     colorclass <border> <background> <text>
1110 }
1111 ----------------------------------------
1112
1113 *Example (default colors)*:
1114 --------------------------------------
1115 bar {
1116     colors {
1117         background #000000
1118         statusline #ffffff
1119
1120         focused_workspace  #4c7899 #285577 #ffffff
1121         active_workspace   #333333 #5f676a #ffffff
1122         inactive_workspace #333333 #222222 #888888
1123         urgent_workspace   #2f343a #900000 #ffffff
1124     }
1125 }
1126 --------------------------------------
1127
1128 == List of commands
1129
1130 Commands are what you bind to specific keypresses. You can also issue commands
1131 at runtime without pressing a key by using the IPC interface. An easy way to
1132 do this is to use the +i3-msg+ utility:
1133
1134 *Example*:
1135 --------------------------
1136 # execute this on your shell to make the current container borderless
1137 i3-msg border none
1138 --------------------------
1139
1140 Commands can be chained by using +;+ (a semicolon). So, to move a window to a
1141 specific workspace and immediately switch to that workspace, you can configure
1142 the following keybinding:
1143
1144 *Example*:
1145 --------------------------------------------------------
1146 bindsym mod+x move container to workspace 3; workspace 3
1147 --------------------------------------------------------
1148
1149 [[command_criteria]]
1150
1151 Furthermore, you can change the scope of a command, that is, which containers
1152 should be affected by that command, by using various criteria. These are
1153 prefixed in square brackets to every command. If you want to kill all windows
1154 which have the class Firefox, use:
1155
1156 *Example*:
1157 ------------------------------------
1158 bindsym mod+x [class="Firefox"] kill
1159
1160 # same thing, but case-insensitive
1161 bindsym mod+x [class="(?i)firefox"] kill
1162 ------------------------------------
1163
1164 The criteria which are currently implemented are:
1165
1166 class::
1167         Compares the window class (the second part of WM_CLASS)
1168 instance::
1169         Compares the window instance (the first part of WM_CLASS)
1170 window_role::
1171         Compares the window role (WM_WINDOW_ROLE).
1172 id::
1173         Compares the X11 window ID, which you can get via +xwininfo+ for example.
1174 title::
1175         Compares the X11 window title (_NET_WM_NAME or WM_NAME as fallback).
1176 urgent::
1177         Compares the urgent state of the window. Can be "latest" or "oldest".
1178         Matches the latest or oldest urgent window, respectively.
1179         (The following aliases are also available: newest, last, recent, first)
1180 con_mark::
1181         Compares the mark set for this container, see <<vim_like_marks>>.
1182 con_id::
1183         Compares the i3-internal container ID, which you can get via the IPC
1184         interface. Handy for scripting.
1185
1186 The criteria +class+, +instance+, +role+, +title+ and +mark+ are actually
1187 regular expressions (PCRE). See +pcresyntax(3)+ or +perldoc perlre+ for
1188 information on how to use them.
1189
1190 [[exec]]
1191
1192 === Executing applications (exec)
1193
1194 What good is a window manager if you can’t actually start any applications?
1195 The exec command starts an application by passing the command you specify to a
1196 shell. This implies that you can use globbing (wildcards) and programs will be
1197 searched in your $PATH.
1198
1199 *Syntax*:
1200 ------------------------------
1201 exec [--no-startup-id] command
1202 ------------------------------
1203
1204 *Example*:
1205 ------------------------------
1206 # Start the GIMP
1207 bindsym mod+g exec gimp
1208
1209 # Start the terminal emulator urxvt which is not yet startup-notification-aware
1210 bindsym mod+Return exec --no-startup-id urxvt
1211 ------------------------------
1212
1213 The +--no-startup-id+ parameter disables startup-notification support for this
1214 particular exec command. With startup-notification, i3 can make sure that a
1215 window appears on the workspace on which you used the exec command. Also, it
1216 will change the X11 cursor to +watch+ (a clock) while the application is
1217 launching. So, if an application is not startup-notification aware (most GTK
1218 and Qt using applications seem to be, though), you will end up with a watch
1219 cursor for 60 seconds.
1220
1221 === Splitting containers
1222
1223 The split command makes the current window a split container. Split containers
1224 can contain multiple windows. Depending on the layout of the split container,
1225 new windows get placed to the right of the current one (splith) or new windows
1226 get placed below the current one (splitv).
1227
1228 If you apply this command to a split container with the same orientation,
1229 nothing will happen. If you use a different orientation, the split container’s
1230 orientation will be changed (if it does not have more than one window). Use
1231 +layout toggle split+ to change the layout of any split container from splitv
1232 to splith or vice-versa.
1233
1234 *Syntax*:
1235 ---------------------------
1236 split <vertical|horizontal>
1237 ---------------------------
1238
1239 *Example*:
1240 ------------------------------
1241 bindsym mod+v split vertical
1242 bindsym mod+h split horizontal
1243 ------------------------------
1244
1245 === Manipulating layout
1246
1247 Use +layout toggle split+, +layout stacking+ or +layout tabbed+ to change the
1248 current container layout to splith/splitv, stacking or tabbed layout,
1249 respectively.
1250
1251 To make the current window (!) fullscreen, use +fullscreen+, to make
1252 it floating (or tiling again) use +floating enable+ respectively +floating disable+
1253 (or +floating toggle+):
1254
1255 *Syntax*:
1256 --------------
1257 layout <tabbed|stacking>
1258 layout toggle [split|all]
1259 --------------
1260
1261 *Examples*:
1262 --------------
1263 bindsym mod+s layout stacking
1264 bindsym mod+l layout toggle split
1265 bindsym mod+w layout tabbed
1266
1267 # Toggle between stacking/tabbed/split:
1268 bindsym mod+x layout toggle
1269
1270 # Toggle between stacking/tabbed/splith/splitv:
1271 bindsym mod+x layout toggle all
1272
1273 # Toggle fullscreen
1274 bindsym mod+f fullscreen
1275
1276 # Toggle floating/tiling
1277 bindsym mod+t floating toggle
1278 --------------
1279
1280 === Focusing/Moving containers
1281
1282 To change the focus, use the focus command: +focus left+, +focus right+, +focus
1283 down+ and +focus up+.
1284
1285 There are a few special parameters you can use for the focus command:
1286
1287 parent::
1288         Sets focus to the +Parent Container+ of the current +Container+.
1289 child::
1290         The opposite of +focus parent+, sets the focus to the last focused
1291         child container.
1292 floating::
1293         Sets focus to the last focused floating container.
1294 tiling::
1295         Sets focus to the last focused tiling container.
1296 mode_toggle::
1297         Toggles between floating/tiling containers.
1298 output::
1299         Followed by a direction or an output name, this will focus the
1300         corresponding output.
1301
1302 For moving, use +move left+, +move right+, +move down+ and +move up+.
1303
1304 *Syntax*:
1305 -----------------------------------
1306 focus <left|right|down|up>
1307 focus <parent|child|floating|tiling|mode_toggle>
1308 focus output <<left|right|down|up>|output>
1309 move <left|right|down|up> [<px> px]
1310 move [absolute] position [[<px> px] [<px> px]|center]
1311 -----------------------------------
1312
1313 Note that the amount of pixels you can specify for the +move+ command is only
1314 relevant for floating containers. The default amount is 10 pixels.
1315
1316 *Examples*:
1317 ----------------------
1318 # Focus container on the left, bottom, top, right:
1319 bindsym mod+j focus left
1320 bindsym mod+k focus down
1321 bindsym mod+l focus up
1322 bindsym mod+semicolon focus right
1323
1324 # Focus parent container
1325 bindsym mod+u focus parent
1326
1327 # Focus last floating/tiling container
1328 bindsym mod+g focus mode_toggle
1329
1330 # Focus the output right to the current one
1331 bindsym mod+x focus output right
1332
1333 # Focus the big output
1334 bindsym mod+x focus output HDMI-2
1335
1336 # Move container to the left, bottom, top, right:
1337 bindsym mod+j move left
1338 bindsym mod+k move down
1339 bindsym mod+l move up
1340 bindsym mod+semicolon move right
1341
1342 # Move container, but make floating containers
1343 # move more than the default
1344 bindsym mod+j move left 20 px
1345
1346 # Move floating container to the center
1347 # of all outputs
1348 bindsym mod+c move absolute position center
1349 ----------------------
1350
1351 === Changing (named) workspaces/moving to workspaces
1352
1353 To change to a specific workspace, use the +workspace+ command, followed by the
1354 number or name of the workspace. To move containers to specific workspaces, use
1355 +move container to workspace+.
1356
1357 You can also switch to the next and previous workspace with the commands
1358 +workspace next+ and +workspace prev+, which is handy, for example, if you have
1359 workspace 1, 3, 4 and 9 and you want to cycle through them with a single key
1360 combination. To restrict those to the current output, use +workspace
1361 next_on_output+ and +workspace prev_on_output+. Similarly, you can use +move
1362 container to workspace next+, +move container to workspace prev+ to move a
1363 container to the next/previous workspace and +move container to workspace current+
1364 (the last one makes sense only when used with criteria).
1365
1366 [[back_and_forth]]
1367 To switch back to the previously focused workspace, use +workspace
1368 back_and_forth+.
1369
1370 To move a container to another xrandr output such as +LVDS1+ or +VGA1+, you can
1371 use the +move container to output+ command followed by the name of the target
1372 output. You may also use +left+, +right+, +up+, +down+ instead of the xrandr
1373 output name to move to the next output in the specified direction.
1374
1375 To move a whole workspace to another xrandr output such as +LVDS1+ or +VGA1+,
1376 you can use the +move workspace to output+ command followed by the name of the
1377 target output. You may also use +left+, +right+, +up+, +down+ instead of the
1378 xrandr output name to move to the next output in the specified direction.
1379
1380 *Syntax*:
1381 -----------------------------------
1382 workspace <next|prev|next_on_output|prev_on_output>
1383 workspace back_and_forth
1384 workspace <name>
1385 workspace number <number>
1386
1387 move [window|container] [to] workspace <name>
1388 move [window|container] [to] workspace number <number>
1389 move [window|container] [to] workspace <prev|next|current>
1390 -----------------------------------
1391
1392 *Examples*:
1393 -------------------------
1394 bindsym mod+1 workspace 1
1395 bindsym mod+2 workspace 2
1396 ...
1397
1398 bindsym mod+Shift+1 move container to workspace 1
1399 bindsym mod+Shift+2 move container to workspace 2
1400 ...
1401
1402 # switch between the current and the previously focused one
1403 bindsym mod+b workspace back_and_forth
1404
1405 # move the whole workspace to the next output
1406 bindsym mod+x move workspace to output right
1407
1408 # move firefox to current workspace
1409 bindsym mod+F1 [class="Firefox"] move workspace current
1410 -------------------------
1411
1412 ==== Named workspaces
1413
1414 Workspaces are identified by their name. So, instead of using numbers in the
1415 workspace command, you can use an arbitrary name:
1416
1417 *Example*:
1418 -------------------------
1419 bindsym mod+1 workspace mail
1420 ...
1421 -------------------------
1422
1423 If you want the workspace to have a number *and* a name, just prefix the
1424 number, like this:
1425
1426 *Example*:
1427 -------------------------
1428 bindsym mod+1 workspace 1: mail
1429 bindsym mod+2 workspace 2: www
1430 ...
1431 -------------------------
1432
1433 Note that the workspace will really be named "1: mail". i3 treats workspace
1434 names beginning with a number in a slightly special way. Normally, named
1435 workspaces are ordered the way they appeared. When they start with a number, i3
1436 will order them numerically. Also, you will be able to use +workspace number 1+
1437 to switch to the workspace which begins with number 1, regardless of which name
1438 it has. This is useful in case you are changing the workspace’s name
1439 dynamically.
1440
1441 === Renaming workspaces
1442
1443 You can rename workspaces. This might be useful to start with the default
1444 numbered workspaces, do your work, and rename the workspaces afterwards to
1445 reflect what’s actually on them.
1446
1447 *Syntax*:
1448 ----------------------------------------------------
1449 rename workspace <old_name> to <new_name>
1450 ----------------------------------------------------
1451
1452 *Examples*:
1453 ------------------------------------------------
1454 i3-msg 'rename workspace 5 to 6'
1455 i3-msg 'rename workspace 1 to "1: www"'
1456 i3-msg 'rename workspace "1: www" to "10: www"'
1457 ------------------------------------------------
1458
1459 [[resizingconfig]]
1460
1461 === Resizing containers/windows
1462
1463 If you want to resize containers/windows using your keyboard, you can use the
1464 +resize+ command:
1465
1466 *Syntax*:
1467 ---------------------------------------------------------
1468 resize <grow|shrink> <direction> [<px> px] [or <ppt> ppt]
1469 ---------------------------------------------------------
1470
1471 Direction can either be one of +up+, +down+, +left+ or +right+. Or you can be
1472 less specific and use +width+ or +height+, in which case i3 will take/give
1473 space from all the other containers. The optional pixel argument specifies by
1474 how many pixels a *floating container* should be grown or shrunk (the default
1475 is 10 pixels). The ppt argument means percentage points and specifies by how
1476 many percentage points a *tiling container* should be grown or shrunk (the
1477 default is 10 percentage points).
1478
1479 I recommend using the resize command inside a so called +mode+:
1480
1481 .Example: Configuration file, defining a mode for resizing
1482 ----------------------------------------------------------------------
1483 mode "resize" {
1484         # These bindings trigger as soon as you enter the resize mode
1485
1486         # Pressing left will shrink the window’s width.
1487         # Pressing right will grow the window’s width.
1488         # Pressing up will shrink the window’s height.
1489         # Pressing down will grow the window’s height.
1490         bindsym j           resize shrink width 10 px or 10 ppt
1491         bindsym k           resize grow height 10 px or 10 ppt
1492         bindsym l           resize shrink height 10 px or 10 ppt
1493         bindsym semicolon   resize grow width 10 px or 10 ppt
1494
1495         # same bindings, but for the arrow keys
1496         bindsym Left        resize shrink width 10 px or 10 ppt
1497         bindsym Down        resize grow height 10 px or 10 ppt
1498         bindsym Up          resize shrink height 10 px or 10 ppt
1499         bindsym Right       resize grow width 10 px or 10 ppt
1500
1501         # back to normal: Enter or Escape
1502         bindsym Return mode "default"
1503         bindsym Escape mode "default"
1504 }
1505
1506 # Enter resize mode
1507 bindsym mod+r mode "resize"
1508 ----------------------------------------------------------------------
1509
1510 === Jumping to specific windows
1511
1512 Often when in a multi-monitor environment, you want to quickly jump to a
1513 specific window. For example, while working on workspace 3 you may want to
1514 jump to your mail client to email your boss that you’ve achieved some
1515 important goal. Instead of figuring out how to navigate to your mailclient,
1516 it would be more convenient to have a shortcut. You can use the +focus+ command
1517 with criteria for that.
1518
1519 *Syntax*:
1520 ----------------------------------------------------
1521 [class="class"] focus
1522 [title="title"] focus
1523 ----------------------------------------------------
1524
1525 *Examples*:
1526 ------------------------------------------------
1527 # Get me to the next open VIM instance
1528 bindsym mod+a [class="urxvt" title="VIM"] focus
1529 ------------------------------------------------
1530
1531 === VIM-like marks (mark/goto)
1532
1533 [[vim_like_marks]]
1534
1535 This feature is like the jump feature: It allows you to directly jump to a
1536 specific window (this means switching to the appropriate workspace and setting
1537 focus to the windows). However, you can directly mark a specific window with
1538 an arbitrary label and use it afterwards.  You do not need to ensure that your
1539 windows have unique classes or titles, and you do not need to change your
1540 configuration file.
1541
1542 As the command needs to include the label with which you want to mark the
1543 window, you cannot simply bind it to a key.  +i3-input+ is a tool created
1544 for this purpose: It lets you input a command and sends the command to i3. It
1545 can also prefix this command and display a custom prompt for the input dialog.
1546
1547 *Syntax*:
1548 ------------------------------
1549 mark identifier
1550 [con_mark="identifier"] focus
1551 ------------------------------
1552
1553 *Example (in a terminal)*:
1554 ------------------------------
1555 $ i3-msg mark irssi
1556 $ i3-msg '[con_mark="irssi"] focus'
1557 ------------------------------
1558
1559 ///////////////////////////////////////////////////////////////////
1560 TODO: make i3-input replace %s
1561 *Examples*:
1562 ---------------------------------------
1563 # Read 1 character and mark the current window with this character
1564 bindsym mod+m exec i3-input -p 'mark ' -l 1 -P 'Mark: '
1565
1566 # Read 1 character and go to the window with the character
1567 bindsym mod+g exec i3-input -p 'goto ' -l 1 -P 'Goto: '
1568 ---------------------------------------
1569
1570 Alternatively, if you do not want to mess with +i3-input+, you could create
1571 seperate bindings for a specific set of labels and then only use those labels.
1572 ///////////////////////////////////////////////////////////////////
1573
1574 === Changing border style
1575
1576 To change the border of the current client, you can use +border normal+ to use the normal
1577 border (including window title), +border 1pixel+ to use a 1-pixel border (no window title)
1578 and +border none+ to make the client borderless.
1579
1580 There is also +border toggle+ which will toggle the different border styles.
1581
1582 *Examples*:
1583 ----------------------------
1584 bindsym mod+t border normal
1585 bindsym mod+y border 1pixel
1586 bindsym mod+u border none
1587 ----------------------------
1588
1589 [[stack-limit]]
1590
1591 ///////////////////////////////////////////////////////////////////////////////
1592 TODO: not yet implemented
1593 === Changing the stack-limit of a container
1594
1595 If you have a single container with a lot of windows inside it (say, more than
1596 10), the default layout of a stacking container can get a little unhandy.
1597 Depending on your screen’s size, you might end up with only half of the title
1598 lines being actually used, wasting a lot of screen space.
1599
1600 Using the +stack-limit+ command, you can limit the number of rows or columns
1601 in a stacking container. i3 will create columns or rows (depending on what
1602 you limited) automatically as needed.
1603
1604 *Syntax*:
1605 --------------------------------
1606 stack-limit <cols|rows> <value>
1607 --------------------------------
1608
1609 *Examples*:
1610 -------------------
1611 # I always want to have two window titles in one line
1612 stack-limit cols 2
1613
1614 # Not more than 5 rows in this stacking container
1615 stack-limit rows 5
1616 -------------------
1617
1618 image:stacklimit.png[Container limited to two columns]
1619 ///////////////////////////////////////////////////////////////////////////////
1620
1621 === Reloading/Restarting/Exiting
1622
1623 You can make i3 reload its configuration file with +reload+. You can also
1624 restart i3 inplace with the +restart+ command to get it out of some weird state
1625 (if that should ever happen) or to perform an upgrade without having to restart
1626 your X session. To exit i3 properly, you can use the +exit+ command,
1627 however you don’t need to (simply killing your X session is fine as well).
1628
1629 *Examples*:
1630 ----------------------------
1631 bindsym mod+Shift+r restart
1632 bindsym mod+Shift+w reload
1633 bindsym mod+Shift+e exit
1634 ----------------------------
1635
1636 === Scratchpad
1637
1638 There are two commands to use any existing window as scratchpad window. +move
1639 scratchpad+ will move a window to the scratchpad workspace. This will make it
1640 invisible until you show it again. There is no way to open that workspace.
1641 Instead, when using +scratchpad show+, the window will be shown again, as a
1642 floating window, centered on your current workspace (using +scratchpad show+ on
1643 a visible scratchpad window will make it hidden again, so you can have a
1644 keybinding to toggle).
1645
1646 As the name indicates, this is useful for having a window with your favorite
1647 editor always at hand. However, you can also use this for other permanently
1648 running applications which you don’t want to see all the time: Your music
1649 player, alsamixer, maybe even your mail client…?
1650
1651 *Syntax*:
1652 ---------------
1653 move scratchpad
1654
1655 scratchpad show
1656 ---------------
1657
1658 *Examples*:
1659 ------------------------------------------------
1660 # Make the currently focused window a scratchpad
1661 bindsym mod+Shift+minus move scratchpad
1662
1663 # Show the first scratchpad window
1664 bindsym mod+minus scratchpad show
1665
1666 # Show the sup-mail scratchpad window, if any.
1667 bindsym mod4+s [title="^Sup ::"] scratchpad show
1668 ------------------------------------------------
1669
1670 [[multi_monitor]]
1671
1672 == Multiple monitors
1673
1674 As you can see in the goal list on the website, i3 was specifically developed
1675 with support for multiple monitors in mind. This section will explain how to
1676 handle multiple monitors.
1677
1678 When you have only one monitor, things are simple. You usually start with
1679 workspace 1 on your monitor and open new ones as you need them.
1680
1681 When you have more than one monitor, each monitor will get an initial
1682 workspace.  The first monitor gets 1, the second gets 2 and a possible third
1683 would get 3. When you switch to a workspace on a different monitor, i3 will
1684 switch to that monitor and then switch to the workspace. This way, you don’t
1685 need shortcuts to switch to a specific monitor, and you don’t need to remember
1686 where you put which workspace. New workspaces will be opened on the currently
1687 active monitor.  It is not possible to have a monitor without a workspace.
1688
1689 The idea of making workspaces global is based on the observation that most
1690 users have a very limited set of workspaces on their additional monitors.
1691 They are often used for a specific task (browser, shell) or for monitoring
1692 several things (mail, IRC, syslog, …). Thus, using one workspace on one monitor
1693 and "the rest" on the other monitors often makes sense. However, as you can
1694 create an unlimited number of workspaces in i3 and tie them to specific
1695 screens, you can have the "traditional" approach of having X workspaces per
1696 screen by changing your configuration (using modes, for example).
1697
1698 === Configuring your monitors
1699
1700 To help you get going if you have never used multiple monitors before, here is
1701 a short overview of the xrandr options which will probably be of interest to
1702 you. It is always useful to get an overview of the current screen configuration.
1703 Just run "xrandr" and you will get an output like the following:
1704 -------------------------------------------------------------------------------
1705 $ xrandr
1706 Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192
1707 VGA1 disconnected (normal left inverted right x axis y axis)
1708 LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm
1709    1280x800       60.0*+   50.0
1710    1024x768       85.0     75.0     70.1     60.0
1711    832x624        74.6
1712    800x600        85.1     72.2     75.0     60.3     56.2
1713    640x480        85.0     72.8     75.0     59.9
1714    720x400        85.0
1715    640x400        85.1
1716    640x350        85.1
1717 --------------------------------------------------------------------------------------
1718
1719 Several things are important here: You can see that +LVDS1+ is connected (of
1720 course, it is the internal flat panel) but +VGA1+ is not. If you have a monitor
1721 connected to one of the ports but xrandr still says "disconnected", you should
1722 check your cable, monitor or graphics driver.
1723
1724 The maximum resolution you can see at the end of the first line is the maximum
1725 combined resolution of your monitors. By default, it is usually too low and has
1726 to be increased by editing +/etc/X11/xorg.conf+.
1727
1728 So, say you connected VGA1 and want to use it as an additional screen:
1729 -------------------------------------------
1730 xrandr --output VGA1 --auto --left-of LVDS1
1731 -------------------------------------------
1732 This command makes xrandr try to find the native resolution of the device
1733 connected to +VGA1+ and configures it to the left of your internal flat panel.
1734 When running "xrandr" again, the output looks like this:
1735 -------------------------------------------------------------------------------
1736 $ xrandr
1737 Screen 0: minimum 320 x 200, current 2560 x 1024, maximum 8192 x 8192
1738 VGA1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm
1739    1280x1024      60.0*+   75.0
1740    1280x960       60.0
1741    1152x864       75.0
1742    1024x768       75.1     70.1     60.0
1743    832x624        74.6
1744    800x600        72.2     75.0     60.3     56.2
1745    640x480        72.8     75.0     66.7     60.0
1746    720x400        70.1
1747 LVDS1 connected 1280x800+1280+0 (normal left inverted right x axis y axis) 261mm x 163mm
1748    1280x800       60.0*+   50.0
1749    1024x768       85.0     75.0     70.1     60.0
1750    832x624        74.6
1751    800x600        85.1     72.2     75.0     60.3     56.2
1752    640x480        85.0     72.8     75.0     59.9
1753    720x400        85.0
1754    640x400        85.1
1755    640x350        85.1
1756 -------------------------------------------------------------------------------
1757 Please note that i3 uses exactly the same API as xrandr does, so it will see
1758 only what you can see in xrandr.
1759
1760 See also <<presentations>> for more examples of multi-monitor setups.
1761
1762 === Interesting configuration for multi-monitor environments
1763
1764 There are several things to configure in i3 which may be interesting if you
1765 have more than one monitor:
1766
1767 1. You can specify which workspace should be put on which screen. This
1768    allows you to have a different set of workspaces when starting than just
1769    1 for the first monitor, 2 for the second and so on. See
1770    <<workspace_screen>>.
1771 2. If you want some applications to generally open on the bigger screen
1772    (MPlayer, Firefox, …), you can assign them to a specific workspace, see
1773    <<assign_workspace>>.
1774 3. If you have many workspaces on many monitors, it might get hard to keep
1775    track of which window you put where. Thus, you can use vim-like marks to
1776    quickly switch between windows. See <<vim_like_marks>>.
1777
1778 == i3 and the rest of your software world
1779
1780 === Displaying a status line
1781
1782 A very common thing amongst users of exotic window managers is a status line at
1783 some corner of the screen. It is an often superior replacement to the widget
1784 approach you have in the task bar of a traditional desktop environment.
1785
1786 If you don’t already have your favorite way of generating such a status line
1787 (self-written scripts, conky, …), then i3status is the recommended tool for
1788 this task. It was written in C with the goal of using as few syscalls as
1789 possible to reduce the time your CPU is woken up from sleep states. Because
1790 i3status only spits out text, you need to combine it with some other tool, like
1791 i3bar. See <<status_command>> for how to display i3status in i3bar.
1792
1793 Regardless of which application you use to display the status line, you
1794 want to make sure that it registers as a dock window using EWMH hints. i3 will
1795 position the window either at the top or at the bottom of the screen, depending
1796 on which hint the application sets. With i3bar, you can configure its position,
1797 see <<i3bar_position>>.
1798
1799 === Giving presentations (multi-monitor)
1800
1801 When giving a presentation, you typically want the audience to see what you see
1802 on your screen and then go through a series of slides (if the presentation is
1803 simple). For more complex presentations, you might want to have some notes
1804 which only you can see on your screen, while the audience can only see the
1805 slides.
1806
1807 [[presentations]]
1808 ==== Case 1: everybody gets the same output
1809 This is the simple case. You connect your computer to the video projector,
1810 turn on both (computer and video projector) and configure your X server to
1811 clone the internal flat panel of your computer to the video output:
1812 -----------------------------------------------------
1813 xrandr --output VGA1 --mode 1024x768 --same-as LVDS1
1814 -----------------------------------------------------
1815 i3 will then use the lowest common subset of screen resolutions, the rest of
1816 your screen will be left untouched (it will show the X background). So, in
1817 our example, this would be 1024x768 (my notebook has 1280x800).
1818
1819 ==== Case 2: you can see more than your audience
1820 This case is a bit harder. First of all, you should configure the VGA output
1821 somewhere near your internal flat panel, say right of it:
1822 -----------------------------------------------------
1823 xrandr --output VGA1 --mode 1024x768 --right-of LVDS1
1824 -----------------------------------------------------
1825 Now, i3 will put a new workspace (depending on your settings) on the new screen
1826 and you are in multi-monitor mode (see <<multi_monitor>>).
1827
1828 Because i3 is not a compositing window manager, there is no ability to
1829 display a window on two screens at the same time. Instead, your presentation
1830 software needs to do this job (that is, open a window on each screen).