]> git.sur5r.net Git - i3/i3/blobdiff - docs/userguide
Merge pull request #1580 from Airblader/feature-nop
[i3/i3] / docs / userguide
index bc105b346ad53900ae3b1b3a32cc411cf7ff0347..3d935e40aac7c2fbf8f5d5f6c2b45e47db4dec8b 100644 (file)
@@ -91,7 +91,7 @@ To display a window in fullscreen mode or to go out of fullscreen mode again,
 press +$mod+f+.
 
 There is also a global fullscreen mode in i3 in which the client will span all
-available outputs (the command is +fullscreen global+).
+available outputs (the command is +fullscreen toggle global+).
 
 === Opening other applications
 
@@ -153,6 +153,7 @@ to upgrade to a newer version of i3) you can use +$mod+Shift+r+.
 === Exiting i3
 
 To cleanly exit i3 without killing your X server, you can use +$mod+Shift+e+.
+By default, a dialog will ask you to confirm if you really want to quit.
 
 === Floating
 
@@ -166,7 +167,8 @@ hint and are opened in floating mode by default.
 You can toggle floating mode for a window by pressing +$mod+Shift+Space+. By
 dragging the window’s titlebar with your mouse you can move the window
 around. By grabbing the borders and moving them you can resize the window. You
-can also do that by using the <<floating_modifier>>.
+can also do that by using the <<floating_modifier>>. Another way to resize
+floating windows using the mouse is to right-click on the titlebar and drag.
 
 For resizing floating windows with your keyboard, see <<resizingconfig>>.
 
@@ -203,7 +205,7 @@ orientation (horizontal, vertical or unspecified) and the orientation depends
 on the layout the container is in (vertical for splitv and stacking, horizontal
 for splith and tabbed). So, in our example with the workspace, the default
 layout of the workspace +Container+ is splith (most monitors are widescreen
-nowadays). If you change the layout to splitv (+$mod+l+ in the default config)
+nowadays). If you change the layout to splitv (+$mod+v+ in the default config)
 and *then* open two terminals, i3 will configure your windows like this:
 
 image::tree-shot2.png["shot2",title="Vertical Workspace Orientation"]
@@ -249,13 +251,13 @@ single workspace on which you open three terminal windows. All these terminal
 windows are directly attached to one node inside i3’s layout tree, the
 workspace node. By default, the workspace node’s orientation is +horizontal+.
 
-Now you move one of these terminals down (+$mod+k+ by default). The workspace
-node’s orientation will be changed to +vertical+. The terminal window you moved
-down is directly attached to the workspace and appears on the bottom of the
-screen. A new (horizontal) container was created to accomodate the other two
-terminal windows. You will notice this when switching to tabbed mode (for
-example). You would end up having one tab called "another container" and the
-other one being the terminal window you moved down.
+Now you move one of these terminals down (+$mod+Shift+k+ by default). The
+workspace node’s orientation will be changed to +vertical+. The terminal window
+you moved down is directly attached to the workspace and appears on the bottom
+of the screen. A new (horizontal) container was created to accommodate the
+other two terminal windows. You will notice this when switching to tabbed mode
+(for example). You would end up having one tab called "another container" and
+the other one being the terminal window you moved down.
 
 [[configuring]]
 == Configuring i3
@@ -365,7 +367,7 @@ bindcode [--release] [Modifiers+]keycode command
 *Examples*:
 --------------------------------
 # Fullscreen
-bindsym $mod+f fullscreen
+bindsym $mod+f fullscreen toggle
 
 # Restart
 bindsym $mod+Shift+r restart
@@ -392,6 +394,41 @@ umlauts or special characters 'and' having some comfortably reachable key
 bindings. For example, when typing, capslock+1 or capslock+2 for switching
 workspaces is totally convenient. Try it :-).
 
+[[mousebindings]]
+
+=== Mouse bindings
+
+A mouse binding makes i3 execute a command upon pressing a specific mouse
+button in the scope of the clicked container (see <<command_criteria>>). You
+can configure mouse bindings in a similar way to key bindings.
+
+*Syntax*:
+----------------------------------
+bindsym [--release] [--whole-window] [Modifiers+]button[n] command
+----------------------------------
+
+By default, the binding will only run when you click on the titlebar of the
+window. If the +--whole-window+ flag is given, it will run when any part of the
+window is clicked. If the +--release+ flag is given, it will run when the mouse
+button is released.
+
+*Examples*:
+--------------------------------
+# The middle button over a titlebar kills the window
+bindsym --release button2 kill
+
+# The middle button and a modifer over any part of the window kills the window
+bindsym --whole-window $mod+button2 kill
+
+# The right button toggles floating
+bindsym button3 floating toggle
+bindsym $mod+button3 floating toggle
+
+# The side buttons move the window around
+bindsym button9 move left
+bindsym button8 move right
+--------------------------------
+
 [[floating_modifier]]
 
 === The floating modifier
@@ -446,7 +483,7 @@ New workspaces get a reasonable default orientation: Wide-screen monitors
 (anything higher than wide) get vertical orientation.
 
 With the +default_orientation+ configuration directive, you can override that
-behaviour.
+behavior.
 
 *Syntax*:
 ----------------------------------------------
@@ -570,11 +607,12 @@ set $m Mod1
 bindsym $m+Shift+r restart
 ------------------------
 
-Variables are directly replaced in the file when parsing. There is no fancy
-handling and there are absolutely no plans to change this. If you need a more
-dynamic configuration you should create a little script which generates a
-configuration file and run it before starting i3 (for example in your
-+~/.xsession+ file).
+Variables are directly replaced in the file when parsing. Variables expansion
+is not recursive so it is not possible to define a variable with a value
+containing another variable. There is no fancy handling and there are
+absolutely no plans to change this. If you need a more dynamic configuration
+you should create a little script which generates a configuration file and run
+it before starting i3 (for example in your +~/.xsession+ file).
 
 === Automatically putting clients on specific workspaces
 
@@ -726,6 +764,9 @@ client.unfocused::
        A client which is not the focused one of its container.
 client.urgent::
        A client which has its urgency hint activated.
+client.placeholder::
+       Background and text color are used to draw placeholder window contents
+       (when restoring layouts). Border and indicator are ignored.
 
 You can also specify the color to be used to paint the background of the client
 windows. This color will be used to paint the window on top of which the client
@@ -748,6 +789,7 @@ client.focused          #4c7899 #285577 #ffffff #2e9ef4
 client.focused_inactive #333333 #5f676a #ffffff #484e50
 client.unfocused        #333333 #222222 #888888 #292d2e
 client.urgent           #2f343a #900000 #ffffff #900000
+client.placeholder      #000000 #0c0c0c #ffffff #000000
 ---------------------------------------------------------
 
 Note that for the window decorations, the color around the child window is the
@@ -804,6 +846,26 @@ focus_follows_mouse <yes|no>
 focus_follows_mouse no
 ----------------------
 
+=== Mouse warping
+
+By default, when switching focus to a window on a different output (e.g.
+focusing a window on workspace 3 on output VGA-1, coming from workspace 2 on
+LVDS-1), the mouse cursor is warped to the center of that window.
+
+With the +mouse_warping+ option, you can control when the mouse cursor should
+be warped. +none+ disables warping entirely, whereas +output+ is the default
+behavior described above.
+
+*Syntax*:
+---------------------------
+mouse_warping <output|none>
+---------------------------
+
+*Example*:
+------------------
+mouse_warping none
+------------------
+
 === Popups during fullscreen mode
 
 When you are in fullscreen mode, some applications still open popup windows
@@ -833,7 +895,7 @@ popup_during_fullscreen smart
 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 behaviour so you can navigate to
+be set on that 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
@@ -860,7 +922,7 @@ inferior Xinerama API explicitly and therefore don’t provide support for
 reconfiguring your screens on the fly (they are read only once on startup and
 that’s it).
 
-For people who do cannot modify their +~/.xsession+ to add the
+For people who cannot modify their +~/.xsession+ to add the
 +--force-xinerama+ commandline parameter, a configuration option is provided:
 
 *Syntax*:
@@ -899,7 +961,7 @@ workspace_auto_back_and_forth yes
 
 If an application on another workspace sets an urgency hint, switching to this
 workspace may lead to immediate focus of the application, which also means the
-window decoration color would be immediately resetted to +client.focused+. This
+window decoration color would be immediately reset to +client.focused+. This
 may make it unnecessarily hard to tell which window originally raised the
 event.
 
@@ -996,20 +1058,39 @@ bar {
 
 === Display mode
 
-You can have i3bar either be visible permanently at one edge of the screen
-(+dock+ mode) or make it show up when you press your modifier key (+hide+
+You can either have i3bar be visible permanently at one edge of the screen
+(+dock+ mode) or make it show up when you press your modifier key (+hide+ mode).
+It is also possible to force i3bar to always stay hidden (+invisible+
 mode). The modifier key can be configured using the +modifier+ option.
 
+The mode option can be changed during runtime through the +bar mode+ command.
+On reload the mode will be reverted to its configured value.
+
 The hide mode maximizes screen space that can be used for actual windows. Also,
 i3bar sends the +SIGSTOP+ and +SIGCONT+ signals to the statusline process to
 save battery power.
 
-The default is dock mode; in hide mode, the default modifier is Mod4 (usually
-the windows key).
+Invisible mode allows to permanently maximize screen space, as the bar is never
+shown. Thus, you can configure i3bar to not disturb you by popping up because
+of an urgency hint or because the modifier key is pressed.
+
+In order to control whether i3bar is hidden or shown in hide mode, there exists
+the hidden_state option, which has no effect in dock mode or invisible mode. It
+indicates the current hidden_state of the bar: (1) The bar acts like in normal
+hide mode, it is hidden and is only unhidden in case of urgency hints or by
+pressing the modifier key (+hide+ state), or (2) it is drawn on top of the
+currently visible workspace (+show+ state).
+
+Like the mode, the hidden_state can also be controlled through i3, this can be
+done by using the +bar hidden_state+ command.
+
+The default mode is dock mode; in hide mode, the default modifier is Mod4 (usually
+the windows key). The default value for the hidden_state is hide.
 
 *Syntax*:
 ----------------
-mode <dock|hide>
+mode <dock|hide|invisible>
+hidden_state <hide|show>
 modifier <Modifier>
 ----------------
 
@@ -1017,12 +1098,52 @@ modifier <Modifier>
 ----------------
 bar {
     mode hide
+    hidden_state hide
     modifier Mod1
 }
 ----------------
 
 Available modifiers are Mod1-Mod5, Shift, Control (see +xmodmap(1)+).
 
+=== Mouse button commands
+
+Specifies a command to run when a button was pressed on i3bar to override the
+default behavior. Currently only the mouse wheel buttons are supported. This is
+useful for disabling the scroll wheel action or running scripts that implement
+custom behavior for these buttons.
+
+*Syntax*:
+---------------------
+wheel_up_cmd <command>
+wheel_down_cmd <command>
+---------------------
+
+*Example*:
+---------------------
+bar {
+    wheel_up_cmd nop
+    wheel_down_cmd exec ~/.i3/scripts/custom_wheel_down
+}
+---------------------
+
+=== Bar ID
+
+Specifies the bar ID for the configured bar instance. If this option is missing,
+the ID is set to 'bar-x', where x corresponds to the position of the embedding
+bar block in the config file ('bar-0', 'bar-1', ...).
+
+*Syntax*:
+---------------------
+id <bar_id>
+---------------------
+
+*Example*:
+---------------------
+bar {
+    id bar-1
+}
+---------------------
+
 [[i3bar_position]]
 === Position
 
@@ -1128,6 +1249,24 @@ bar {
 }
 --------------------------------------------------------------
 
+=== Custom separator symbol
+
+Specifies a custom symbol to be used for the separator as opposed to the vertical,
+one pixel thick separator. Note that you may have to adjust the +sep_block_width+ 
+property.
+
+*Syntax*:
+-------------------------
+separator_symbol <symbol>
+-------------------------
+
+*Example*:
+------------------------
+bar {
+    separator_symbol ":|:"
+}
+------------------------
+
 === Workspace buttons
 
 Specifies whether workspace buttons should be shown or not. This is useful if
@@ -1141,11 +1280,57 @@ workspace_buttons <yes|no>
 --------------------------
 
 *Example*:
---------------------
+------------------------
 bar {
     workspace_buttons no
 }
---------------------
+------------------------
+
+=== Strip workspace numbers
+
+Specifies whether workspace numbers should be displayed within the workspace
+buttons. This is useful if you want to have a named workspace that stays in
+order on the bar according to its number without displaying the number prefix.
+
+When +strip_workspace_numbers+ is set to +yes+, any workspace that has a name of
+the form "[n]:[NAME]" will display only the name. You could use this, for
+instance, to display Roman numerals rather than digits by naming your
+workspaces to "1:I", "2:II", "3:III", "4:IV", ...
+
+The default is to display the full name within the workspace button.
+
+*Syntax*:
+----------------------------------
+strip_workspace_numbers <yes|no>
+----------------------------------
+
+*Example*:
+----------------------------
+bar {
+    strip_workspace_numbers yes
+}
+----------------------------
+
+=== Binding Mode indicator
+
+Specifies whether the current binding mode indicator should be shown or not.
+This is useful if you want to hide the workspace buttons but still be able
+to see the current binding mode indicator.
+For an example of a +mode+ definition, see <<resizingconfig>>.
+
+The default is to show the mode indicator.
+
+*Syntax*:
+-------------------------------
+binding_mode_indicator <yes|no>
+-------------------------------
+
+*Example*:
+-----------------------------
+bar {
+    binding_mode_indicator no
+}
+-----------------------------
 
 === Colors
 
@@ -1172,7 +1357,7 @@ inactive_workspace::
        will be the case for most workspaces.
 urgent_workspace::
        Border, background and text color for a workspace button when the workspace
-       window with the urgency hint set.
+       contains a window with the urgency hint set. Also applies to +mode+ indicators.
 
 *Syntax*:
 ----------------------------------------
@@ -1225,16 +1410,28 @@ bindsym $mod+x move container to workspace 3; workspace 3
 [[command_criteria]]
 
 Furthermore, you can change the scope of a command - that is, which containers
-should be affected by that command, by using various criteria. These are
-prefixed in square brackets to every command. If you want to kill all windows
-which have the class Firefox, use:
+should be affected by that command, by using various criteria. The criteria
+are specified before any command in a pair of square brackets and are separated
+by space.
+
+When using multiple commands, separate them by using a +,+ (a comma) instead of
+a semicolon. Criteria apply only until the next semicolon, so if you use a
+semicolon to separate commands, only the first one will be executed for the
+matched window(s).
 
 *Example*:
 ------------------------------------
+# if you want to kill all windows which have the class Firefox, use:
 bindsym $mod+x [class="Firefox"] kill
 
 # same thing, but case-insensitive
 bindsym $mod+x [class="(?i)firefox"] kill
+
+# kill only the About dialog from Firefox
+bindsym $mod+x [class="Firefox" window_role="About"] kill
+
+# enable floating mode and move container to workspace 4
+for_window [class="^evil-app$"] floating enable, move container to workspace 4
 ------------------------------------
 
 The criteria which are currently implemented are:
@@ -1324,9 +1521,13 @@ Use +layout toggle split+, +layout stacking+, +layout tabbed+, +layout splitv+
 or +layout splith+ to change the current container layout to splith/splitv,
 stacking, tabbed layout, splitv or splith, respectively.
 
-To make the current window (!) fullscreen, use +fullscreen+, to make
-it floating (or tiling again) use +floating enable+ respectively +floating disable+
-(or +floating toggle+):
+To make the current window (!) fullscreen, use +fullscreen enable+ (or
++fullscreen enable global+ for the global mode), to leave either fullscreen
+mode use +fullscreen disable+, and to toggle between these two states use
++fullscreen toggle+ (or +fullscreen toggle global+).
+
+Likewise, to make the current window floating (or tiling again) use +floating
+enable+ respectively +floating disable+ (or +floating toggle+):
 
 *Syntax*:
 --------------
@@ -1347,7 +1548,7 @@ bindsym $mod+x layout toggle
 bindsym $mod+x layout toggle all
 
 # Toggle fullscreen
-bindsym $mod+f fullscreen
+bindsym $mod+f fullscreen toggle
 
 # Toggle floating/tiling
 bindsym $mod+t floating toggle
@@ -1442,6 +1643,10 @@ container to the next/previous workspace and +move container to workspace curren
 See <<move_to_outputs>> for how to move a container/workspace to a different
 RandR output.
 
+Workspace names are parsed as
+https://developer.gnome.org/pango/stable/PangoMarkupFormat.html[Pango markup]
+by i3bar.
+
 [[back_and_forth]]
 To switch back to the previously focused workspace, use +workspace
 back_and_forth+; likewise, you can move containers to the previously focused
@@ -1463,6 +1668,7 @@ move [window|container] [to] workspace <prev|next|current>
 -------------------------
 bindsym $mod+1 workspace 1
 bindsym $mod+2 workspace 2
+bindsym $mod+3 workspace 3:<span foreground="red">vim</span>
 ...
 
 bindsym $mod+Shift+1 move container to workspace 1
@@ -1515,7 +1721,7 @@ specify a default name if there's currently no workspace starting with a "1".
 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
-the currently focused workspace. This is handy if you wan't to use the
+the currently focused workspace. This is handy if you want to use the
 rename command with +i3-input+.
 
 *Syntax*:
@@ -1530,7 +1736,7 @@ i3-msg 'rename workspace 5 to 6'
 i3-msg 'rename workspace 1 to "1: www"'
 i3-msg 'rename workspace "1: www" to "10: www"'
 i3-msg 'rename workspace to "2: mail"
-bindsym $mod+r exec i3-input -F 'rename workspace to %s' -P 'New name: '
+bindsym $mod+r exec i3-input -F 'rename workspace to "%s"' -P 'New name: '
 --------------------------------------------------------------------------
 
 === Moving workspaces to a different screen
@@ -1641,9 +1847,10 @@ bindsym $mod+a [class="urxvt" title="VIM"] focus
 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
-an arbitrary label and use it afterwards.  You do not need to ensure that your
-windows have unique classes or titles, and you do not need to change your
-configuration file.
+an arbitrary label and use it afterwards. You can unmark the label in the same
+way, using the unmark command. If you don't specify a label, unmark removes all
+marks. You do not need to ensure that your windows have unique classes or
+titles, and you do not need to change your configuration file.
 
 As the command needs to include the label with which you want to mark the
 window, you cannot simply bind it to a key.  +i3-input+ is a tool created
@@ -1654,12 +1861,14 @@ can also prefix this command and display a custom prompt for the input dialog.
 ------------------------------
 mark identifier
 [con_mark="identifier"] focus
+unmark identifier
 ------------------------------
 
 *Example (in a terminal)*:
 ------------------------------
 $ i3-msg mark irssi
 $ i3-msg '[con_mark="irssi"] focus'
+$ i3-msg unmark irssi
 ------------------------------
 
 ///////////////////////////////////////////////////////////////////
@@ -1724,6 +1933,51 @@ stack-limit rows 5
 image:stacklimit.png[Container limited to two columns]
 ///////////////////////////////////////////////////////////////////////////////
 
+[[shmlog]]
+
+=== Enabling shared memory logging
+
+As described in http://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
+discarded and a new one will be started.
+
+*Syntax*:
+------------------------------
+shmlog <size_in_bytes>
+shmlog <on|off|toggle>
+------------------------------
+
+*Examples*:
+---------------
+# Enable/disable logging
+bindsym $mod+x shmlog toggle
+
+# or, from a terminal:
+# increase the shared memory log buffer to 50 MiB
+i3-msg shmlog $((50*1024*1024))
+---------------
+
+=== 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
+likely useful in combination with the above-described <<shmlog>> command.
+
+*Syntax*:
+------------------------
+debuglog <on|off|toggle>
+------------------------
+
+*Examples*:
+------------------------
+# Enable/disable logging
+bindsym $mod+x debuglog toggle
+------------------------
+
 === Reloading/Restarting/Exiting
 
 You can make i3 reload its configuration file with +reload+. You can also
@@ -1775,6 +2029,59 @@ bindsym $mod+minus scratchpad show
 bindsym mod4+s [title="^Sup ::"] scratchpad show
 ------------------------------------------------
 
+=== 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.
+
+The optional +comment+ argument is ignored, but will be printed to the log file
+for debugging purposes.
+
+*Syntax*:
+---------------
+nop [<comment>]
+---------------
+
+*Example*:
+----------------------------------------------
+# Disable focus change for clicks on titlebars
+# with the middle mouse button
+bindsym button2 nop
+----------------------------------------------
+
+=== 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
+respectively mode option of each bar. It is also possible to toggle between
+hide state and show state as well as between dock mode and hide mode. Each
+i3bar instance can be controlled individually by specifying a bar_id, if none
+is given, the command is executed for all bar instances.
+
+*Syntax*:
+---------------
+bar hidden_state hide|show|toggle [<bar_id>]
+
+bar mode dock|hide|invisible|toggle [<bar_id>]
+---------------
+
+*Examples*:
+------------------------------------------------
+# Toggle between hide state and show state
+bindsym $mod+m bar hidden_state toggle
+
+# Toggle between dock mode and hide mode
+bindsym $mod+n bar mode toggle
+
+# Set the bar instance with id 'bar-1' to switch to hide mode
+bindsym $mod+b bar mode hide bar-1
+
+# Set the bar instance with id 'bar-1' to always stay hidden
+bindsym $mod+Shift+b bar mode invisible bar-1
+------------------------------------------------
+
 [[multi_monitor]]
 
 == Multiple monitors