X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=docs%2Fuserguide.html;h=d98a8c5193b4ab58ad20ca589b26e32acd652220;hb=8924ec1339061840e02c918d36c86dd179a86aac;hp=7362e009e59589ead8d341ebbc791f070c22291d;hpb=0a716379dbf172d480de4a7fba89dc9c79d6a204;p=i3%2Fi3.github.io diff --git a/docs/userguide.html b/docs/userguide.html index 7362e00..d98a8c5 100644 --- a/docs/userguide.html +++ b/docs/userguide.html @@ -32,7 +32,6 @@ document.addEventListener("DOMContentLoaded", function(){asciidoc.footnotes(); a

i3 User’s Guide

Michael Stapelberg
<michael@i3wm.org>
-March 2013
Table of Contents
@@ -50,7 +49,7 @@ mailing list.

1. Default keybindings

For the "too long; didn’t read" people, here is an overview of the default -keybindings (click to see the full size image):

+keybindings (click to see the full-size image):

Keys to use with $mod (Alt):

@@ -78,7 +77,8 @@ above, just decline i3-config-wizard’s offer and base your config on

Throughout this guide, the keyword $mod will be used to refer to the configured modifier. This is the Alt key (Mod1) by default, with the Windows -key (Mod4) being a popular alternative.

+key (Mod4) being a popular alternative that largely prevents conflicts with +application-defined shortcuts.

2.1. Opening terminals and moving around

One very basic operation is opening a new terminal. By default, the keybinding @@ -248,7 +248,7 @@ finally the windows themselves. In previous versions of i3 we had multiple lists out to be complicated to use (snapping), understand and implement.

3.1. The tree consists of Containers

-

The building blocks of our tree are so called Containers. A Container can +

The building blocks of our tree are so-called Containers. A Container can host a window (meaning an X11 window, one that you can actually see and use, like a browser). Alternatively, it could contain one or more Containers. A simple example is the workspace: When you start i3 with a single monitor, a @@ -576,7 +576,7 @@ mode "$mode_launcher" {

4.6. The floating modifier

To move floating windows with your mouse, you can either grab their titlebar -or configure the so called floating modifier which you can then press and +or configure the so-called floating modifier which you can then press and click anywhere in the window itself to move it. The most common setup is to use the same key you use for managing windows (Mod1 for example). Then you can press Mod1, click into a window using your left mouse button, and drag @@ -651,33 +651,35 @@ start.

-

4.10. Border style for new windows

+

4.10. Default border style for new windows

This option determines which border style new windows will have. The default is -normal. Note that new_float applies only to windows which are starting out as +normal. Note that default_floating_border applies only to windows which are starting out as floating windows, e.g., dialog windows, but not windows that are floated later on.

Syntax:

-
new_window normal|none|pixel
-new_window normal|pixel <px>
-new_float normal|none|pixel
-new_float normal|pixel <px>
+
default_border normal|none|pixel
+default_border normal|pixel <px>
+default_floating_border normal|none|pixel
+default_floating_border normal|pixel <px>
+

Please note that new_window and new_float have been deprecated in favor of the above options +and will be removed in a future release. We strongly recommend using the new options instead.

Example:

-
new_window pixel
+
default_border pixel

The "normal" and "pixel" border styles support an optional border width in pixels:

Example:

-
# The same as new_window none
-new_window pixel 0
+
# The same as default_border none
+default_border pixel 0
 
 # A 3 px border
-new_window pixel 3
+default_border pixel 3
@@ -810,13 +812,17 @@ starts up being named Firefox, and only when Vimperator is loaded does the title change. As i3 will get the title as soon as the application maps the window (mapping means actually displaying it on the screen), you’d need to have to match on Firefox in this case.

+

You can also assign a window to show up on a specific output. You can use RandR +names such as VGA1 or names relative to the output with the currently focused +workspace such as left and down.

Assignments are processed by i3 in the order in which they appear in the config file. The first one which matches the window wins and later assignments are not considered.

Syntax:

-
assign <criteria> [→] [workspace] <workspace>
+
assign <criteria> [→] [workspace] [number] <workspace>
+assign <criteria> [→] output left|right|up|down|primary|<output>

Examples:

@@ -833,10 +839,27 @@ assign [class="^URxvt$"] → 2 # Assignment to a named workspace assign [class="^URxvt$"] → work +# Assign to the workspace with number 2, regardless of name +assign [class="^URxvt$"] → number 2 + +# You can also specify a number + name. If the workspace with number 2 exists, assign will skip the text part. +assign [class="^URxvt$"] → number "2: work" + # Start urxvt -name irssi -assign [class="^URxvt$" instance="^irssi$"] → 3 +assign [class="^URxvt$" instance="^irssi$"] → 3 + +# Assign urxvt to the output right of the current one +assign [class="^URxvt$"] → output right + +# Assign urxvt to the primary output +assign [class="^URxvt$"] → output primary +
+

Note that you might not have a primary output configured yet. To do so, run:

+
+
+
xrandr --output <output> --primary
-

Note that the arrow is not required, it just looks good :-). If you decide to +

Also, the arrow is not required, it just looks good :-). If you decide to use it, it has to be a UTF-8 encoded arrow, not -> or something like that.

To get the class and instance, you can use xprop. After clicking on the window, you will see the following output:

@@ -848,7 +871,7 @@ window, you will see the following output:

The first part of the WM_CLASS is the instance ("irssi" in this example), the second part is the class ("URxvt" in this example).

Should you have any problems with assignments, make sure to check the i3 -logfile first (see http://i3wm.org/docs/debugging.html). It includes more +logfile first (see https://i3wm.org/docs/debugging.html). It includes more details about the matching process and the window’s actual class, instance and title when starting up.

Note that if you want to start an application just once on a specific @@ -909,6 +932,16 @@ the second screen and so on).

The output is the name of the RandR output you attach your screen to. On a laptop, you might have VGA1 and LVDS1 as output names. You can see the available outputs by running xrandr --current.

+

If your X server supports RandR 1.5 or newer, i3 will use RandR monitor objects +instead of output objects. Run xrandr --listmonitors to see a list. Usually, +a monitor object contains exactly one output, and has the same name as the +output; but should that not be the case, you may specify the name of either the +monitor or the output in i3’s configuration. For example, the Dell UP2414Q uses +two scalers internally, so its output names might be “DP1” and “DP2”, but the +monitor name is “Dell UP2414Q”.

+

(Note that even if you specify the name of an output which doesn’t span the +entire monitor, i3 will still use the entire area of the containing monitor +rather than that of just the output’s.)

If you use named workspaces, they must be quoted:

Examples:

@@ -1103,29 +1136,40 @@ Leave fullscreen mode.

4.24. Focus wrapping

-

When being in a tabbed or stacked container, the first container will be -focused when you use focus down on the last container — the focus wraps. If -however there is another stacked/tabbed container in that direction, focus will -be set on that container. This is the default behavior so you can navigate to -all your windows without having to use focus parent.

+

By default, when in a container with several windows or child containers, the +opposite window will be focused when trying to move the focus over the edge of +a container (and there are no other containers in that direction) — the focus +wraps.

+

If desired, you can disable this behavior by setting the focus_wrapping +configuration directive to the value no.

+

When enabled, focus wrapping does not occur by default if there is another +window or container in the specified direction, and focus will instead be set +on that window or container. This is the default behavior so you can navigate +to all your windows without having to use focus parent.

If you want the focus to always wrap and you are aware of using focus -parent to switch to different containers, you can use the -force_focus_wrapping configuration directive. After enabling it, the focus -will always wrap.

+parent to switch to different containers, you can instead set focus_wrapping +to the value force.

Syntax:

-
force_focus_wrapping yes|no
+
focus_wrapping yes|no|force
+
+# Legacy syntax, equivalent to "focus_wrapping force"
+force_focus_wrapping yes
-

Example:

+

Examples:

-
force_focus_wrapping yes
+
# Disable focus wrapping
+focus_wrapping no
+
+# Force focus wrapping
+focus_wrapping force

4.25. Forcing Xinerama

-

As explained in-depth in http://i3wm.org/docs/multi-monitor.html, some X11 +

As explained in-depth in https://i3wm.org/docs/multi-monitor.html, some X11 video drivers (especially the nVidia binary driver) only provide support for Xinerama instead of RandR. In such a situation, i3 must be told to use the inferior Xinerama API explicitly and therefore don’t provide support for @@ -1456,7 +1500,7 @@ and will be removed in a future release. We strongly recommend using the more ge

Syntax:

-
bindsym button<n> <command>
+
bindsym [--release] button<n> <command>

Example:

@@ -1464,6 +1508,8 @@ and will be removed in a future release. We strongly recommend using the more ge
bar {
     # disable clicking on workspace buttons
     bindsym button1 nop
+    # Take a screenshot by right clicking on the bar
+    bindsym --release button3 exec --no-startup-id import /tmp/latest-screenshot.png
     # execute custom script when scrolling downwards
     bindsym button5 exec ~/.i3/scripts/custom_wheel_down
 }
@@ -2141,6 +2187,15 @@ bindsym $mod+t floating toggle available:

+<criteria> +
+
+

+ Sets focus to the container that matches the specified criteria. + See [command_criteria]. +

+
+
left|right|up|down
@@ -2202,14 +2257,18 @@ output

Syntax:

-
focus left|right|down|up
+
<criteria> focus
+focus left|right|down|up
 focus parent|child|floating|tiling|mode_toggle
 focus output left|right|up|down|primary|<output>

Examples:

-
# Focus container on the left, bottom, top, right
+
# Focus firefox
+bindsym $mod+F1 [class="Firefox"] focus
+
+# Focus container on the left, bottom, top, right
 bindsym $mod+j focus left
 bindsym $mod+k focus down
 bindsym $mod+l focus up
@@ -2230,77 +2289,97 @@ bindsym $mod+x focus output HDMI-2
 # Focus the primary output
 bindsym $mod+x focus output primary
+

Note that you might not have a primary output configured yet. To do so, run:

-
Note that you might not have a primary output configured yet. To do so, run:
+
xrandr --output <output> --primary
-

xrandr --output <output> --primary

+
+
+

6.5. Moving containers

+

Use the move command to move a container.

+

Syntax:

-
=== Moving containers
-
-Use the +move+ command to move a container.
-
-*Syntax*:
-
-

# Moves the container into the given direction. +

# Moves the container into the given direction.
 # The optional pixel argument specifies how far the
 # container should be moved if it is floating and
 # defaults to 10 pixels.
-move <left|right|down|up> [<px> px]

-

# Moves the container either to a specific location -# or to the center of the screen. If absolute is +move <left|right|down|up> [<px> px] + +# Moves the container either to a specific location +# or to the center of the screen. If 'absolute' is # used, it is moved to the center of all outputs. move [absolute] position <pos_x> [px] <pos_y> [px] -move [absolute] position center

-

# Moves the container to the current position of the +move [absolute] position center + +# Moves the container to the current position of the # mouse cursor. Only affects floating containers. -move position mouse

+move position mouse
+
+

Examples:

-
*Examples*:
-
-

# Move container to the left, bottom, top, right +

# Move container to the left, bottom, top, right
 bindsym $mod+j move left
 bindsym $mod+k move down
 bindsym $mod+l move up
-bindsym $mod+semicolon move right

-

# Move container, but make floating containers +bindsym $mod+semicolon move right + +# Move container, but make floating containers # move more than the default -bindsym $mod+j move left 20 px

-

# Move floating container to the center of all outputs -bindsym $mod+c move absolute position center

-

# Move container to the current position of the cursor -bindsym $mod+m move position mouse

-
-
-
=== Swapping containers
+bindsym $mod+j move left 20 px
 
-Two containers can be swapped (i.e., move to each other's position) by using
-the +swap+ command. They will assume the position and geometry of the container
-they are swapped with.
+# Move floating container to the center of all outputs
+bindsym $mod+c move absolute position center
 
-The first container to participate in the swapping can be selected through the
+# Move container to the current position of the cursor
+bindsym $mod+m move position mouse
+
+
+
+

6.6. Swapping containers

+

Two containers can be swapped (i.e., move to each other’s position) by using +the swap command. They will assume the position and geometry of the container +they are swapped with.

+

The first container to participate in the swapping can be selected through the normal command criteria process with the focused window being the usual fallback if no criteria are specified. The second container can be selected -using one of the following methods: - -+id+:: The X11 window ID of a client window. -+con_id+:: The i3 container ID of a container. -+mark+:: A container with the specified mark, see <<vim_like_marks>>. - -Note that swapping does not work with all containers. Most notably, swapping +using one of the following methods:

+
+
+id +
+
+

+The X11 window ID of a client window. +

+
+
+con_id +
+
+

+The i3 container ID of a container. +

+
+
+mark +
+
+

+A container with the specified mark, see [vim_like_marks]. +

+
+
+

Note that swapping does not work with all containers. Most notably, swapping floating containers or containers that have a parent-child relationship to one -another does not work. - -*Syntax*: +another does not work.

+

Syntax:

+
+
+
swap container with id|con_id|mark <arg>
-
-
-
-
-

7. swap container with id|con_id|mark <arg>

-

Examples:

@@ -2310,8 +2389,9 @@ swap container with mark swapee # Swaps container marked »A« and »B« [con_mark="^A$"] swap container with mark B
+
-

7.1. Sticky floating windows

+

6.7. Sticky floating windows

If you want a window to stick to the glass, i.e., have it stay on screen even if you switch to another workspace, you can use the sticky command. For example, this can be useful for notepads, a media player or a video chat @@ -2331,7 +2411,7 @@ for_window [instance=notepad] sticky enable

-

7.2. Changing (named) workspaces/moving to workspaces

+

6.8. Changing (named) workspaces/moving to workspaces

To change to a specific workspace, use the workspace command, followed by the number or name of the workspace. Pass the optional flag --no-auto-back-and-forth to disable [back_and_forth] for this specific call @@ -2391,7 +2471,7 @@ bindsym $mod+x move workspace to output right bindsym $mod+F1 [class="Firefox"] move workspace current

-

7.2.1. Named workspaces

+

6.8.1. Named workspaces

Workspaces are identified by their name. So, instead of using numbers in the workspace command, you can use an arbitrary name:

Example:

@@ -2419,7 +2499,7 @@ dynamically. To combine both commands you can use workspace number 1: mail
-

7.2.2. Renaming workspaces

+

6.8.2. Renaming workspaces

You can rename workspaces. This might be useful to start with the default numbered workspaces, do your work, and rename the workspaces afterwards to reflect what’s actually on them. You can also omit the old name to rename @@ -2457,12 +2537,12 @@ to "1: web", the above command will still switch to it.

-

7.3. Moving workspaces to a different screen

+

6.9. Moving workspaces to a different screen

See [move_to_outputs] for how to move a container/workspace to a different RandR output.

-

7.4. Moving containers/workspaces to RandR outputs

+

6.10. Moving containers/workspaces to RandR outputs

To move a container to another RandR output (addressed by names like LVDS1 or VGA1) or to a RandR output identified by a specific direction (like left, right, up or down), there are two commands:

@@ -2485,45 +2565,40 @@ bindsym $mod+x move container to output VGA1 # Put this window on the primary output. bindsym $mod+x move container to output primary
+

Note that you might not have a primary output configured yet. To do so, run:

-
Note that you might not have a primary output configured yet. To do so, run:
+
xrandr --output <output> --primary
-

xrandr --output <output> --primary

-
-
-
=== Moving containers/windows to marks
-
-To move a container to another container with a specific mark (see <<vim_like_marks>>),
-you can use the following command.
-
-The window will be moved right after the marked container in the tree, i.e., it ends up
+
+
+

6.11. Moving containers/windows to marks

+

To move a container to another container with a specific mark (see [vim_like_marks]), +you can use the following command.

+

The window will be moved right after the marked container in the tree, i.e., it ends up in the same position as if you had opened a new window when the marked container was focused. If the mark is on a split container, the window will appear as a new child -after the currently focused child within that container. - -*Syntax*: +after the currently focused child within that container.

+

Syntax:

+
+
+
move window|container to mark <mark>
-
-
- -
-

8. move window|container to mark <mark>

-

Example:

for_window [instance="tabme"] move window to mark target
+
-

8.1. Resizing containers/windows

+

6.12. Resizing containers/windows

If you want to resize containers/windows using your keyboard, you can use the resize command:

Syntax:

resize grow|shrink <direction> [<px> px [or <ppt> ppt]]
-resize set <width> [px] <height> [px]
+resize set <width> [px | ppt] <height> [px | ppt]

Direction can either be one of up, down, left or right. Or you can be less specific and use width or height, in which case i3 will take/give @@ -2531,8 +2606,10 @@ space from all the other containers. The optional pixel argument specifies by how many pixels a floating container should be grown or shrunk (the default is 10 pixels). The ppt argument means percentage points and specifies by how many percentage points a tiling container should be grown or shrunk (the -default is 10 percentage points). Note that resize set will only work for -floating containers.

+default is 10 percentage points).

+

Notes about resize set: a value of 0 for <width> or <height> means "do +not resize in this direction", and resizing a tiling container by px is not +implemented.

It is recommended to define bindings for resizing in a dedicated binding mode. See [binding_modes] and the example in the i3 default config for more @@ -2544,7 +2621,7 @@ context.

-

8.2. Jumping to specific windows

+

6.13. Jumping to specific windows

Often when in a multi-monitor environment, you want to quickly jump to a specific window. For example, while working on workspace 3 you may want to jump to your mail client to email your boss that you’ve achieved some @@ -2565,7 +2642,7 @@ bindsym $mod+a [class="urxvt" title="VIM"] focus

-

8.3. VIM-like marks (mark/goto)

+

6.14. VIM-like marks (mark/goto)

This feature is like the jump feature: It allows you to directly jump to a specific window (this means switching to the appropriate workspace and setting focus to the windows). However, you can directly mark a specific window with @@ -2608,7 +2685,7 @@ unmark irssi

-

8.4. Window title format

+

6.15. Window title format

By default, i3 will simply print the X11 window title. Using title_format, this can be customized by setting the format to the desired output. This directive supports @@ -2666,7 +2743,7 @@ for_window [class="(?i)firefox"] title_format "<span foreground='red'>%tit

-

8.5. Changing border style

+

6.16. Changing border style

To change the border of the current client, you can use border normal to use the normal border (including window title), border pixel 1 to use a 1-pixel border (no window title) and border none to make the client borderless.

@@ -2695,8 +2772,8 @@ bindsym $mod+u border none
-

8.6. Enabling shared memory logging

-

As described in http://i3wm.org/docs/debugging.html, i3 can log to a shared +

6.17. Enabling shared memory logging

+

As described in https://i3wm.org/docs/debugging.html, i3 can log to a shared memory buffer, which you can dump using i3-dump-log. The shmlog command allows you to enable or disable the shared memory logging at runtime.

Note that when using shmlog <size_in_bytes>, the current log will be @@ -2719,7 +2796,7 @@ i3-msg shmlog $((50*1024*1024))

-

8.7. Enabling debug logging

+

6.18. Enabling debug logging

The debuglog command allows you to enable or disable debug logging at runtime. Debug logging is much more verbose than non-debug logging. This command does not activate shared memory logging (shmlog), and as such is most @@ -2737,7 +2814,7 @@ bindsym $mod+x debuglog toggle

-

8.8. Reloading/Restarting/Exiting

+

6.19. Reloading/Restarting/Exiting

You can make i3 reload its configuration file with reload. You can also restart i3 inplace with the restart command to get it out of some weird state (if that should ever happen) or to perform an upgrade without having to restart @@ -2752,7 +2829,7 @@ bindsym $mod+Shift+e exit

-

8.9. Scratchpad

+

6.20. Scratchpad

There are two commands to use any existing window as scratchpad window. move scratchpad will move a window to the scratchpad workspace. This will make it invisible until you show it again. There is no way to open that workspace. @@ -2787,7 +2864,7 @@ bindsym mod4+s [title="^Sup ::"] scratchpad show

-

8.10. Nop

+

6.21. Nop

There is a no operation command nop which allows you to override default behavior. This can be useful for, e.g., disabling a focus change on clicks with the middle mouse button.

@@ -2807,7 +2884,7 @@ bindsym button2 nop
-

8.11. i3bar control

+

6.22. i3bar control

There are two options in the configuration of each i3bar instance that can be changed during runtime by invoking a command through i3. The commands bar hidden_state and bar mode allow setting the current hidden_state @@ -2841,7 +2918,7 @@ bindsym $mod+Shift+b bar mode invisible bar-1

-

9. Multiple monitors

+

7. Multiple monitors

As you can see in the goal list on the website, i3 was specifically developed with support for multiple monitors in mind. This section will explain how to @@ -2864,7 +2941,7 @@ create an unlimited number of workspaces in i3 and tie them to specific screens, you can have the "traditional" approach of having X workspaces per screen by changing your configuration (using modes, for example).

-

9.1. Configuring your monitors

+

7.1. Configuring your monitors

To help you get going if you have never used multiple monitors before, here is a short overview of the xrandr options which will probably be of interest to you. It is always useful to get an overview of the current screen configuration. @@ -2927,7 +3004,7 @@ only what you can see in xrandr.

See also [presentations] for more examples of multi-monitor setups.

-

9.2. Interesting configuration for multi-monitor environments

+

7.2. Interesting configuration for multi-monitor environments

There are several things to configure in i3 which may be interesting if you have more than one monitor:

    @@ -2964,10 +3041,10 @@ For information on how to move existing workspaces between monitors,
-

10. i3 and the rest of your software world

+

8. i3 and the rest of your software world

-

10.1. Displaying a status line

+

8.1. Displaying a status line

A very common thing amongst users of exotic window managers is a status line at some corner of the screen. It is an often superior replacement to the widget approach you have in the task bar of a traditional desktop environment.

@@ -2984,14 +3061,14 @@ on which hint the application sets. With i3bar, you can configure its position, see [i3bar_position].

-

10.2. Giving presentations (multi-monitor)

+

8.2. Giving presentations (multi-monitor)

When giving a presentation, you typically want the audience to see what you see on your screen and then go through a series of slides (if the presentation is simple). For more complex presentations, you might want to have some notes which only you can see on your screen, while the audience can only see the slides.

-

10.2.1. Case 1: everybody gets the same output

+

8.2.1. Case 1: everybody gets the same output

This is the simple case. You connect your computer to the video projector, turn on both (computer and video projector) and configure your X server to clone the internal flat panel of your computer to the video output:

@@ -3004,7 +3081,7 @@ your screen will be left untouched (it will show the X background). So, in our example, this would be 1024x768 (my notebook has 1280x800).

-

10.2.2. Case 2: you can see more than your audience

+

8.2.2. Case 2: you can see more than your audience

This case is a bit harder. First of all, you should configure the VGA output somewhere near your internal flat panel, say right of it: