diff --git a/debian/changelog b/debian/changelog index 059fa32..eda728e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,754 +1,5 @@ -i3-wm (4.18.1-1) unstable; urgency=medium +i3-gaps (4.18.1-0kali1) kali-dev; urgency=medium - * New upstream release. + * Initial release - -- Michael Stapelberg Mon, 17 Feb 2020 18:25:47 +0100 - -i3-wm (4.18-1) unstable; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Mon, 17 Feb 2020 18:25:47 +0100 - -i3-wm (4.17.1-1) unstable; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Fri, 30 Aug 2019 23:06:40 +0200 - -i3-wm (4.17-1) unstable; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Sat, 03 Aug 2019 15:14:28 +0200 - -i3-wm (4.16.1-1) unstable; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Sun, 27 Jan 2019 16:45:11 +0100 - -i3-wm (4.16-1) unstable; urgency=medium - - * UNRELEASED - - -- Michael Stapelberg Sun, 04 Nov 2018 14:47:25 +0100 - -i3-wm (4.15-1) unstable; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Sat, 10 Mar 2018 17:27:26 +0100 - -i3-wm (4.14.1-1) unstable; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Sun, 24 Sep 2017 19:21:15 +0200 - -i3-wm (4.14-1) unstable; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Mon, 04 Sep 2017 07:53:16 +0200 - -i3-wm (4.13-1) unstable; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Tue, 08 Nov 2016 19:02:16 +0100 - -i3-wm (4.12-2) unstable; urgency=medium - - * Override lintian warning desktop-entry-contains-unknown-key for - DesktopNames, gdm needs that key. - * Remove i3-wm.menu to conform to the tech-ctte decision on #741573. - - -- Michael Stapelberg Fri, 01 Apr 2016 15:51:23 +0200 - -i3-wm (4.12-1) unstable; urgency=medium - - * New upstream release. - * Move to debhelper 9 - * Bump Standards-Version to 3.9.7 (no changes necessary) - * debian/watch: verify signature, use https - - -- Michael Stapelberg Sun, 06 Mar 2016 14:20:38 +0100 - -i3-wm (4.11-1) unstable; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Wed, 30 Sep 2015 08:50:13 +0200 - -i3-wm (4.10.4-1) unstable; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Tue, 08 Sep 2015 09:15:45 +0200 - -i3-wm (4.10.3-1) unstable; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Thu, 30 Jul 2015 21:51:27 +0200 - -i3-wm (4.10.2-2) unstable; urgency=medium - - * New upstream release. - * experimental to unstable because i3-wm 4.10.2-1 was only in experimental - due to the freeze. - - -- Michael Stapelberg Fri, 01 May 2015 20:21:18 +0200 - -i3-wm (4.10.2-1) experimental; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Thu, 16 Apr 2015 09:02:53 +0200 - -i3-wm (4.10.1-1) experimental; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Sun, 29 Mar 2015 18:54:07 +0200 - -i3-wm (4.10-1) experimental; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Sun, 29 Mar 2015 17:46:09 +0200 - -i3-wm (4.9.1-1) experimental; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Sat, 07 Mar 2015 20:01:46 +0100 - -i3-wm (4.9-1) experimental; urgency=medium - - * New upstream release. - - -- Michael Stapelberg Sat, 28 Feb 2015 14:53:34 +0100 - -i3-wm (4.8-2) unstable; urgency=medium - - * Backport two bugfixes: - - backport-dpi-fix.patch (Closes: #778460) - - backport-i3bar-tray-fix.patch (Closes: #778461) - - -- Michael Stapelberg Sun, 15 Feb 2015 13:24:42 +0100 - -i3-wm (4.8-1) unstable; urgency=medium - - * New upstream release. - * Bump standards-version to 3.9.5 (no changes necessary) - - -- Michael Stapelberg Sun, 15 Jun 2014 19:15:29 +0200 - -i3-wm (4.7.2-1) unstable; urgency=low - - * New upstream release. (Closes: #736396) - - -- Michael Stapelberg Thu, 23 Jan 2014 23:03:03 +0100 - -i3-wm (4.7.1-1) unstable; urgency=low - - * New upstream release. - - -- Michael Stapelberg Tue, 21 Jan 2014 19:29:34 +0100 - -i3-wm (4.7-1) unstable; urgency=low - - * New upstream release. - - -- Michael Stapelberg Sun, 22 Dec 2013 21:19:02 +0100 - -i3-wm (4.6-1) unstable; urgency=low - - * New upstream release. - - -- Michael Stapelberg Wed, 07 Aug 2013 20:53:26 +0200 - -i3-wm (4.5.1-2) unstable; urgency=low - - * experimental to unstable because i3-wm 4.5.1 was only in experimental due - to the freeze. - * bump standards-version to 3.9.4 (no changes necessary) - - -- Michael Stapelberg Tue, 14 May 2013 20:48:16 +0200 - -i3-wm (4.5.1-1) experimental; urgency=low - - * New upstream release - - -- Michael Stapelberg Mon, 18 Mar 2013 22:50:12 +0100 - -i3-wm (4.5-1) experimental; urgency=low - - * New upstream release - - -- Michael Stapelberg Tue, 12 Mar 2013 13:51:04 +0100 - -i3-wm (4.4-1) experimental; urgency=low - - * New upstream release - - -- Michael Stapelberg Tue, 11 Dec 2012 22:52:56 +0100 - -i3-wm (4.3-1) experimental; urgency=low - - * New upstream release - - -- Michael Stapelberg Wed, 19 Sep 2012 18:13:40 +0200 - -i3-wm (4.2-1) unstable; urgency=low - - * New upstream release - - -- Michael Stapelberg Wed, 25 Apr 2012 23:19:44 +0200 - -i3-wm (4.1.2-3) unstable; urgency=low - - * Disable generation of docs/refcard.pdf (Closes: #666363) - * Add debian/i3-wm.menu (Closes: #664697) - * Bump standards-version to 3.9.3 (no changes needed) - * Fix 'section' field of the i3-wm source package to 'x11' - * Email change: Michael Stapelberg -> stapelberg@debian.org - - -- Michael Stapelberg Thu, 12 Apr 2012 16:09:58 +0200 - -i3-wm (4.1.2-2) unstable; urgency=low - - * Rebuild against libyajl and libxcb from unstable - - -- Michael Stapelberg Fri, 27 Jan 2012 19:50:29 +0000 - -i3-wm (4.1.2-1) unstable; urgency=low - - * Bugfix: Don’t lose focus on fullscreen windows when another window gets - moved to that workspace - * Bugfix: Open new windows in the correct place when assignments match - * Bugfix: Fix assignments of floating windows to (yet) unused workspaces - * Bugfix: Either use SetInputFocus *or* send WM_TAKE_FOCUS, not both - * Bugfix: Respect WM_HINTS.input for WM_TAKE_FOCUS clients - * Bugfix: Setup the _NET_SUPPORTING_WM_CHECK atom in a standards-compliant - way - * Bugfix: Only ignore EnterNotify events after UnmapNotifies from managed - windows - * Bugfix: Force a new sequence number after UnmapNotify - * Bugfix: Position floating windows exactly where their geometry specified - * Bugfix: Fix coordinates when the rect of an output changes - - -- Michael Stapelberg Fri, 27 Jan 2012 19:04:28 +0000 - -i3-wm (4.1.1-1) unstable; urgency=low - - * Re-add build-arch/build-indep targets to debian/rules (Closes: #648613) - * Create a secure temp path instead of a predictable one - * ipc: set CLOEXEC on client file descriptors - * Fix prototype in include/xcursor.h - * Bugfix: Skip dock clients when handling FocusIn events - * Bugfix: Fix fullscreen with floating windows - * Bugfix: Fix startup when RandR is not present - * Bugfix: Retain window position and size when changing floating border - * Bugfix: Disallow focusing dock clients via criteria - * Bugfix: Don’t create a workspace named 'back_and_forth' on startup - * Bugfix: Fix wrong focus in complex tabbed/stacked layouts - * Bugfix: Fix resizing for (e.g.) v-split containers in h-split containers - * Bugfix: Fix 'resize' command in nested containers - * Bugfix: Don’t set the _NET_WM_WORKAREA hint at all - * Bugfix: Skip leading whitespace in variable assignments - * Bugfix: Make resizing of tiling windows with floating_modifier use absolute - coordinates - * Bugfix: Make resizing work when pressing floating_modifier + right mouse - button on window decorations - * Bugfix: Fix setting the same mark repeatedly on different windows - * Bugfix: Disallow focusing other windows when in fullscreen mode - * Bugfix: Ignore ConfigureRequests with out-of-bound coordinates - * Bugfix: Correctly check boundaries and reassign floating windows when - moving - * Bugfix: Don’t close workspace when there are still floating windows on it - - -- Michael Stapelberg Sat, 24 Dec 2011 16:23:55 +0100 - -i3-wm (4.1-1) unstable; urgency=low - - * Switch to dpkg-source 3.0 (quilt) and compat level 7 - * Implement system tray support in i3bar (for NetworkManager, Skype, …) - * i3bar is now configurable in the i3 configfile - * Implement support for PCRE regular expressions in criteria - * Implement a new assign syntax which uses criteria - * Sort named workspaces whose name starts with a number accordingly - * Warn on duplicate bindings for the same key - * Restrict 'resize' command to left/right for horizontal containers, up/down - for vertical containers - * Implement support for startup notifications (cursor will change to 'watch', - started applications show up on the workspace they have been launched on) - * Implement the GET_MARKS IPC request to get all marks - * Implement the new_float config option (border style for floating windows) - * Implement passing IPC sockets to i3 (systemd-style socket activation) - * Implement the 'move output' command to move containers to a specific output - * Implement focus switching for floating windows - * Implement the window_role criterion (for matching multi-window apps) - * Implement a force_xinerama configuration directive - * Implement the --get-socketpath, useful for scripts using the IPC interface - * Implement the 'move workspace next' and 'move workspace prev' commands - * Implement the 'workspace back_and_forth' command and related configuration - option - * Implement the move command for floating windows - * i3 will now handle arbitrary text arguments by sending them as an IPC - command, like i3-msg: 'i3 reload' or 'i3 move workspace 3' - * Introduce the i3-sensible-{pager,editor,terminal} scripts to execute - $PAGER, $EDITOR or an available terminal emulator - * i3-input: implement -F (format) option - * Bugfix: Preserve marks when restarting - * Bugfix: Correctly free old assignments when reloading - * Bugfix: Fix flickering when moving floating windows between monitors - * Bugfix: Correctly handle ConfigureRequests for floating windows in a - multi-monitor environment. - * Bugfix: Fix size of floating windows with X11 borders - * Bugfix: Always adjust floating window position when moving to another - output - * Bugfix: Avoid out-of-bounds coordinates when moving floating windows - * Bugfix: Don’t steal focus when a window gets destroyed - * Bugfix: Correctly split key/value when parsing variables - * Bugfix: Correctly revert focus to other floating windows when closing a - floating window - * Bugfix: Don’t leak the error logfile file descriptor - * Bugfix: Don’t steal focus when a window opens on an invisible workspace due - to assignments - * Bugfix: Fix handling of Mode_switch in i3-input - * Bugfix: Close invisible workspaces when they become empty - * Bugfix: Don’t invoke interactive resizing when clicking on the decoration - of a split container with more than one child (switch focus instead) - * Bugfix: Make named workspace assignments work again - * Bugfix: RandR: Correctly keep focus on the focused workspace when an output - disappears - * Bugfix: Insert container at the correct position on workspace level when - workspace_layout == default - - -- Michael Stapelberg Fri, 11 Nov 2011 21:28:15 +0000 - -i3-wm (4.0.2-1) unstable; urgency=low - - * i3-config-wizard: handle mouse button clicks on and texts - * i3-config-wizard: check the modifier mapping to decide whether to use Mod1 - or Mod4 - * migrate-config: use \s, be a bit more whitespace tolerant - * userguide: s/mod+h/mod+s for stacking - * userguide: provide the default colors in the colors example - * userguide: document force_focus_wrapping directive - * userguide: properly document the resize command - * userguide: properly document command chaining and criteria - * Bugfix: Correctly bind on multiple keycodes if a symbol has more than one - * Bugfix: Allow multiple criteria in 'for_window' - * Bugfix: Ensure a minimum size when using the 'resize' command - * Bugfix: Start on the first named workspace, not always on '1' - * Bugfix: Fix resize command with direction != up for floating windows - * Bugfix: Correctly set the _NET_CLIENT_LIST_STACKING hint (chromium tabbar) - * Bugfix: 'workspace ' now takes all outputs into account - * Bugfix: i3-wsbar: make workspace names clickable again - * Bugfix: i3-wsbar: correctly handle EOF on stdin - * Bugfix: i3-wsbar: display a separator between workspaces of each output - * Bugfix: Correctly handle the 'instance' criterion (WM_CLASS) - * Bugfix: Use correct format string in load_layout (fixes crash in restart) - * Bugfix: Fix border rendering (border lines were "cutting" through) - * Bugfix: Raise floating windows immediately when dragging/resizing - * Bugfix: Make focus switching work across outputs again - * Bugfix: migration-script: handle resize top/bottom correctly - * Bugfix: Fix focus issue when moving containers to workspaces - * Bugfix: Warp cursor when changing outputs again - * Bugfix: i3bar: fix switching to workspaces with extremely long names - * Bugfix: i3bar: fix switching to workspaces "next" and "prev" - * Bugfix: i3bar: Correctly allocate pixmap for statuslines which are longer - than the screen - * Bugfix: i3bar: set statusline = NULL on EOF / SIGCHLD - * Bugfix: Correctly initialize the verbose flag - * Bugfix: Don’t start with workspace 'next' when the command 'workspace next' - is bound in the config file - * Bugfix: Set focus to where the mouse pointer is when starting - * Bugfix: Don’t change focus when assigned windows start on invisible - workspaces - * Bugfix: Don’t use absolute paths for exec in the config file - * Bugfix: Fix crash when using 'focus mode_toggle' on an empty workspace - * Bugfix: Make the 'resize' command work inside tabbed/stacked cons - * Bugfix: Correctly place floating windows on their appropriate output - * Bugfix: Fix coordinates when moving a floating window to a different output - * Bugfix: Correctly keep focus when moving non-leaf windows - * Bugfix: Accept '\t' in the set command - * Bugfix: Only consider tiling windows when attaching tiling windows to a - workspace - * Bugfix: Correctly render containers when a split container is focused - * Bugfix: Correctly recognize duplicate workspace assignments - * Bugfix: Re-enable X11 Eventmask *after* pushing all the X11 changes - * Bugfix: Fix focus stealing with assignments of floating windows - * Bugfix: Re-implement reconfiguring height of dock windows - * Bugfix: IPC: return name_json if available - * Bugfix: Make 'floating enable' check for dock windows - - -- Michael Stapelberg Sun, 28 Aug 2011 19:07:43 +0200 - -i3-wm (4.0.1-1) unstable; urgency=low - - * Fix the build process of i3bar (Closes: #636274) - * Fix the build process on Mac OS X - * i3-config-wizard: also start i3bar in the keycode config template - * userguide: Remove the obsolete bar.* colors - * userguide: Use i3bar instead of dzen2 in the 'exec' example - - -- Michael Stapelberg Mon, 01 Aug 2011 23:31:06 +0200 - -i3-wm (4.0-1) unstable; urgency=low - - * In addition to the proper flex/bison based parser for the config file - introduced in 3.δ, we now also have a flex/bison parser for commands. What - this means is that we can have more human-readable, beautiful command names - instead of cryptic commands like 'f' for fullscreen or 'mh' for move left. - In fact, the commands for the aforementioned functions *are* 'fullscreen' - and 'move left'! - * You can now chain commands using ';' (a semicolon). One example for that is - 'workspace 3 ; exec /usr/bin/urxvt' to switch to a new workspace and open a - terminal. - * You can specify which windows should be affected by your command by using - different criteria. A good example is '[class="Firefox"] kill' to get rid - of all Firefox windows. - * As the configuration file needs new commands (and a few options are - obsolete), you need to change it. To make this process a little bit easier - for you, this release comes with the script i3-migrate-config-to-v4. Just - run it on your current config file and it will spit out a v4 config file to - stdout. To make things even better, i3 automatically detects v3 config files - and calls that script, so you never end up with a non-working config :). - * Similarly to the criteria when using commands, we now have a 'for_window' - configuration directive, which lets you automatically apply certain commands - to certain windows. Use it to set border styles per window, for example with - 'for_window [class="XTerm"] border 1pixel'. - * Since dock clients (like dzen2) are now part of the layout tree (as opposed - to a custom data structure as before), it was easy to implement top and - bottom dock areas. Programs which properly specify the dock hint get placed - on the edge of the screen they request. i3bar has the -dtop and -dbottom - parameters, for example. - * The internal workspace bar is obsolete. Use i3bar instead. - * Resizing now works between all windows! - * Fullscreen now works for everything! - * Floating now works for everything! - * Your layout is now preserved when doing an inplace restart. - * When you have an error in your config file, a new program called i3-nagbar - will tell you so. It offers you two buttons: One to view the error in your - $PAGER and one to edit your config in your $EDITOR. - * The default config used key symbols (like 'bind Mod1+f fullscreen') instead - of key codes. If you use a non-qwerty layout, the program i3-config-wizard - can create a key symbol based config file based on your current layout. You - can also chose between Windows (Mod4) and Alt (Mod1) as your default - modifier. i3-config-wizard will automatically be started as long as you - don’t have a configuration file for i3. - * Custom X cursor themes are now supported. - * The RandR backend now respects the primary output. - * A wrong 'font' configuration in your config file will no longer make i3 - exit. Instead, it will fall back to a different font and tell you about the - error in its log. - * The default split direction (whether a new window gets placed right next to - the current one or below the current one) is now automatically set to - horizontal if you have a monitor that is wider than high or vertical if you - a monitor which is higher than wide. This works great with rotated monitors. - * Sockets and temporary files are now placed in XDG_RUNTIME_DIR, if set (this - is used on systemd based systems). - * Tools like i3bar, i3-msg etc. use the I3_SOCKET_PATH property which is set - to the X11 root window, so you don’t have to configure your socket path - anywhere. - * The kill command kills single windows by default now. To kill a whole - application, use 'kill client'. - * IPC: Commands can now have custom replies. When the parser encounters an - error, a proper error reply is sent. - * There is now an 'exec_always' configuration directive which works like - 'exec' but will also be run when restarting. - - -- Michael Stapelberg Sun, 31 Jul 2011 22:34:26 +0200 - -i3-wm (3.e-bf1-3) unstable; urgency=low - - * include keyboard-layer{1,2}.png in docs (Closes: #595295) - - -- Michael Stapelberg Wed, 03 Nov 2010 20:32:42 +0100 - -i3-wm (3.e-bf1-2) unstable; urgency=low - - * debian: call dh_installwm to register as alternative for x-window-manager - - -- Michael Stapelberg Wed, 23 Jun 2010 18:23:10 +0200 - -i3-wm (3.e-bf1-1) unstable; urgency=low - - * Bugfix: Correctly initialize workspaces if RandR is not available - * Bugfix: Correctly handle asprintf() return value - * Bugfix: Update _NET_WM_STATE when clients request changes via ClientMessage - * Bugfix: Don’t invert directions when resizing floating clients (top/left) - * Bugfix: Don’t leak file descriptors - - -- Michael Stapelberg Wed, 09 Jun 2010 09:51:10 +0200 - -i3-wm (3.e-3) unstable; urgency=low - - * Bump debian policy version - * Add Recommends: libanyevent-i3-perl, libanyevent-perl, libipc-run-perl - which are necessary to use i3-wsbar (which is not core functionality, - thus no Depends:) (Closes: #577287) - - -- Michael Stapelberg Sat, 24 Apr 2010 11:20:19 +0200 - -i3-wm (3.e-2) unstable; urgency=low - - * Use x-terminal-emulator instead of hard-coded urxvt - - -- Michael Stapelberg Sun, 04 Apr 2010 19:30:46 +0200 - -i3-wm (3.e-1) unstable; urgency=low - - * Implement RandR instead of Xinerama - * Obey the XDG Base Directory Specification for config file paths - * lexer/parser: proper error messages - * Add new options -V for verbose mode and -d for debug log levels - * Implement resize command for floating clients - * Include date of the last commit in version string - * Fixed cursor orientation when resizing - * Added focus_follows_mouse config option - * Feature: Cycle through workspaces - * Fix bindings using the cursor keys in default config - * added popup for handling SIGSEGV or SIGFPE - * Correctly exit when another window manager is already running - * Take into account the window’s base_{width,height} when resizing - * Disable XKB instead of quitting with an error - * Make containers containing exactly one window behave like default containers - * Also warp the pointer when moving a window to a another visible workspace - * work around clients setting 0xFFFF as resize increments - * Move autostart after creating the IPC socket in start process - * Restore geometry of all windows before exiting/restarting - * When in fullscreen mode, focus whole screens instead of denying to focus - * draw consistent borders for each frame in a tabbed/stacked container - * Update fullscreen client position/size when an output changes - * i3-input: Bugfix: repeatedly grab the keyboard if it does not succeed - * put windows with WM_CLIENT_LEADER on the workspace of their leader - * use real functions instead of nested functions (enables compilation with - llvm-clang) - * implement screen-spanning fullscreen mode - * floating resize now uses arbitrary corners - * floating resize now works proportionally when pressing shift - * Don’t use SYNC key bindings for mode_switch but re-grab keys - * support PREFIX and SYSCONFDIR in Makefile - * make pointer follow the focus when moving to a different screen also for - floating clients - * start dock clients on the output they request to be started on according - to their geometry - * handle destroy notify events like unmap notify events - * ewmh: correctly set _NET_CURRENT_DESKTOP to the number of the active - workspace - * ewmh: correctly set _NET_ACTIVE_WINDOW - * ewmh: implement support for _NET_WORKAREA (rdesktop can use that) - * default ipc-socket path is now ~/.i3/ipc.sock, enabled in the default config - * Bugfix: Containers could lose their snap state - * Bugfix: Use ev_loop_new to not block SIGCHLD - * Bugfix: if a font provides no per-char info for width, fall back to default - * Bugfix: lexer: return to INITIAL state after floating_modifier - * Bugfix: Don’t leak IPC socket to launched processes - * Bugfix: Use both parts of WM_CLASS (it contains instance and class) - * Bugfix: Correctly do boundary checking/moving to other workspaces when - moving floating clients via keyboard - * Bugfix: checked for wrong flag in size hints - * Bugfix: Correctly render workspace names containing some non-ascii chars - * Bugfix: Correctly position floating windows sending configure requests - * Bugfix: Don’t remap stack windows errnously when changing workspaces - * Bugfix: configure floating windows above tiling windows when moving them - to another workspace - * Bugfix: Take window out of fullscreen mode before entering floating mode - * Bugfix: Don’t enter BIND_A2WS_COND state too early - * Bugfix: only restore focus if the workspace is focused, not if it is visible - * Bugfix: numlock state will now be filtered in i3-input and signal handler - * Bugfix: Don’t unmap windows when current workspace gets reassigned - * Bugfix: correctly translate coordinates for floating windows when outputs - change - * Bugfix: Correctly switch workspace when using the "jump" command - * Bugfix: Fix rendering of workspace names after "reload" - * Bugfix: Correctly ignore clicks when in fullscreen mode - * Bugfix: Don’t allow fullscreen floating windows to be moved - * Bugfix: Don’t render containers which are not visible on hint changes - * Some memory leaks/invalid accesses have been fixed - - -- Michael Stapelberg Tue, 30 Mar 2010 13:11:50 +0200 - -i3-wm (3.d-bf1-1) unstable; urgency=low - - * Bugfix: Don’t draw window title when titlebar is disabled - * Bugfix: Correctly switch border types for floating windows - * Bugfix: Correctly replay pointer if the click handler does not trigger - * Bugfix: Also allow WORDs as workspace names - * Bugfix: Correctly clear the urgency hint if a window gets unmapped without - clearing it - * Bugfix: Fix resizing of floating windows in borderless/1-px-border mode - * Bugfix: Accept underscores in bindsym - * Bugfix: Don’t set the urgency flag if the window is focused - * Bugfix: Handle stack-limit cols on tabbed containers - * Bugfix: Resize client after updating base_width/base_height - * Bugfix: Force render containers after setting the client active - * Bugfix: Fix two problems in resizing floating windows with right mouse - * Bugfix: Use more precise floating point arithmetics - * Bugfix: Correctly place new windows below fullscreen windows - - -- Michael Stapelberg Mon, 21 Dec 2009 22:33:02 +0100 - -i3-wm (3.d-2) unstable; urgency=low - - * debian: register in doc-base - * debian: add watchfile - * debian: remove unnecessary priority-field from binary packages - * debian: add missing images to documentation - - -- Michael Stapelberg Mon, 23 Nov 2009 21:56:04 +0100 - -i3-wm (3.d-1) unstable; urgency=low - - * Implement tabbing (command "T") - * Implement horizontal resize of containers (containers! not windows) - * Implement the urgency hint for windows/workspaces - * Implement vim-like marks (mark/goto command) - * Implement stack-limit for further defining how stack windows should look - * Implement modes which allow you to use a different set of keybindings - when inside a specific mode - * Implement changing the default mode of containers - * Implement long options (--version, --no-autostart, --help, --config) - * Implement 'bt' to toggle between the different border styles - * Implement an option to specify the default border style - * Use a yacc/lex parser/lexer for the configuration file - * The number of workspaces is now dynamic instead of limited to 10 - * Floating windows (and tiled containers) can now be resized using - floating_modifier and right mouse button - * Dock windows can now reconfigure their height - * Bugfix: Correctly handle multiple messages on the IPC socket - * Bugfix: Correctly use base_width, base_height and size increment hints - * Bugfix: Correctly send fake configure_notify events - * Bugfix: Don’t crash if the numlock symbol cannot be found - * Bugfix: Don’t display a colon after unnamed workspaces - * Bugfix: If the pointer is outside of the screen when starting, fall back to - the first screen. - * Bugfix: Initialize screens correctly when not using Xinerama - * Bugfix: Correctly handle unmap_notify events when resizing - * Bugfix: Correctly warp pointer after rendering the layout - * Bugfix: Fix NULL pointer dereference when reconfiguring screens - * Explicitly specify -lxcb when linking (Closes: #554860) - - -- Michael Stapelberg Mon, 09 Nov 2009 20:53:43 +0100 - -i3-wm (3.c-2) unstable; urgency=low - - * Fix FTBFS on GNU/kFreeBSD and possibly GNU/Hurd (Closes: #542877) - * Add manpage for i3-msg - - -- Michael Stapelberg Mon, 24 Aug 2009 12:23:18 +0200 - -i3-wm (3.c-1) unstable; urgency=low - - * Implement a reload command - * Implement keysymbols in configuration file - * Implement assignments of workspaces to screens - * Implement named workspaces - * Implement borderless/1-px-border windows - * Implement command to focus screens - * Implement IPC via unix sockets - * Correctly render decoration of floating windows - * Map floating windows requesting (0x0) to center of their leader/workspace - * Optimization: Render stack windows on pixmaps to reduce flickering - * Optimization: Directly position new windows to their final position - * Bugfix: Repeatedly try to find screens if none are available - * Bugfix: Correctly redecorate clients when changing focus - * Bugfix: Don’t crash when clients reconfigure themselves - * Bugfix: Fix screen wrapping - * Bugfix: Fix selecting a different screen with your mouse when not having - any windows on the current workspace - * Bugfix: Correctly unmap stack windows and don’t re-map them too early - * Bugfix: Allow switching layout if there are no clients in the this container - * Bugfix: Set WM_STATE_WITHDRAWN when unmapping, unmap windows when - destroying - * Bugfix: Don’t hide assigned clients to inactive but visible workspaces - - -- Michael Stapelberg Wed, 19 Aug 2009 13:07:58 +0200 - -i3-wm (3.b-1) unstable; urgency=low - - * Bugfix: Correctly handle col-/rowspanned containers when setting focus. - * Bugfix: Correctly handle col-/rowspanned containers when snapping. - * Bugfix: Force reconfiguration of all windows on workspaces which are - re-assigned because a screen was detached. - * Bugfix: Several bugs in resizing table columns fixed. - * Bugfix: Resizing should now work correctly in all cases. - * Bugfix: Correctly re-assign dock windows when workspace is destroyed. - * Bugfix: Correctly handle Mode_switch modifier. - * Bugfix: Don't raise clients in fullscreen mode. - * Bugfix: Re-assign dock windows to different workspaces when a workspace - is detached. - * Bugfix: Fix crash because of workspace-pointer which did not get updated - * Bugfix: Correctly initialize screen when Xinerama is disabled. - * Bugfix: Fullscreen window movement and focus problems fixed - * Implement jumping to other windows by specifying their position or - window class/title. - * Implement jumping back by using the focus stack. - * Implement autostart (exec-command in configuration file). - * Implement floating. - * Implement automatically assigning clients on specific workspaces. - * Implement variables in configfile. - * Colors are now configurable. - - -- Michael Stapelberg Fri, 26 Jun 2009 04:42:23 +0200 - -i3-wm (3.a-bf2-1) unstable; urgency=low - - * Bugfix: Don't crash when setting focus - * Bugfix: Reconfigure bar window when changing resolutions - - -- Michael Stapelberg Sun, 03 May 2009 23:02:24 +0200 - -i3-wm (3.a-bf1-1) unstable; urgency=low - - * Bugfix: When entering a stack window with the mouse, set focus to the - active client in the container the stack window belongs to. - * Bugfix: Correctly filter out the numlock bit. This fixes i3 not reacting - to any keybindings after pressing numlock once. - * Bugfix: Don't crash when Xinerama is disabled. - * Bugfix: Correctly remove client from container when moving to another - workspace. - * Bugfix: Set focus to the client which was previously focused instead of - the next client in container when moving windows out of a container. - * Bugfix: Correctly set focus when switching between screens. - * Bugfix: Don't crash anymore moving focus to another screen under the - following conditions: The screen you switch to has a lower number of cells - and/or rows than the current one, you switch focus using your mouse, you - previously were in a column/row which is not available on the destination - screen. - * Bugfix: When switching screens, warp the pointer to the correct - destination window. - * Bugfix: Store dock clients per screen, not per workspace. - * Bugfix: Perform bounds checking for snapped containers. - * Bugfix: Send clients their absolute position/size (on the root window) in - generated configure events. This fixes problems with xfontsel, xmaple, - etc. - * Bugfix: Correctly update state when moving fullscreen windows across - workspaces. - * Bugfix: Correctly restart i3 when not using its absolute path - * Bugfix: Drag & Drop in GTK applications works now - * Bugfix: Don't hide non-managed windows (libnotify-popups for example) - when raising clients in stacked containers. - * Bugfix: Correctly restore focus when leaving fullscreen mode - * Bugfix: Re-distribute free space when closing customly resized containers, - re-evaluate for other containers - * Bugfix: When moving windows into different containers, insert them at the - correct position. - * Bugfix: Correctly set focus when moving windows into other containers - * Implement scrolling on stack windows and on the bottom bar. - * Create i3-wm-dbg with debug symbols - * Don't rely on libxcb-wm any longer, as it got removed in libxcb 0.3.4. - - -- Michael Stapelberg Sat, 02 May 2009 20:55:46 +0200 - -i3-wm (3.a-1) unstable; urgency=low - - * First release (Closes: #521709) - - -- Michael Stapelberg Sun, 29 Mar 2009 18:21:30 +0200 + -- Joseph O'Gorman Thu, 16 Apr 2020 16:41:23 -0400 diff --git a/debian/control b/debian/control index 843e655..0d57787 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,8 @@ -Source: i3-wm +Source: i3-gaps Section: x11 Priority: extra -Maintainer: Michael Stapelberg +Maintainer: Kali Developers +Uploaders: Joseph O'Gorman Build-Depends: debhelper (>= 9), dh-autoreconf, libx11-dev, @@ -26,37 +27,66 @@ libstartup-notification0-dev (>= 0.10), libcairo2-dev (>= 1.14.4), libpango1.0-dev, - libpod-simple-perl -Standards-Version: 3.9.8 -Homepage: https://i3wm.org/ + libpod-simple-perl, + xcb, + libxcb1-dev, + libxcb-xrm0, + libxcb-shape0, +Standards-Version: 4.5.0 +Homepage: https://github.com/Airblader/i3 +Vcs-Browser: https://gitlab.com/kalilinux/packages/i3-gaps +Vcs-Git: https://gitlab.com/kalilinux/packages/i3-gaps.git -Package: i3 +Package: i3-gaps Architecture: any -Depends: i3-wm (=${binary:Version}), ${misc:Depends} -Recommends: i3lock (>= 2.2), suckless-tools, i3status (>= 2.3), dunst -Description: metapackage (i3 window manager, screen locker, menu, statusbar) - This metapackage installs the i3 window manager (i3-wm), the i3lock screen +Depends: i3-gaps-wm (=${binary:Version}), ${misc:Depends}, sensible-utils, libc6, libxcb-cursor0, + dh-autoreconf, + gcc, + libev-dev, + libpango1.0-dev, + libstartup-notification0-dev, + libxcb-cursor-dev, + libxcb-icccm4-dev, + libxcb-keysyms1-dev, + libxcb-randr0-dev, + libxcb-shape0, + libxcb-shape0-dev, + libxcb-util0-dev, + libxcb-xinerama0-dev, + libxcb-xkb-dev, + libxcb-xrm-dev, + libxcb-xrm0, + libxcb1-dev, + libxkbcommon-dev, + libxkbcommon-x11-dev, + libyajl-dev, + make, + xcb +Recommends: i3lock-color, suckless-tools, i3status (>= 2.3), dunst +Conflicts: i3 +Description: metapackage (i3-gaps window manager, screen locker, menu, statusbar) + This metapackage installs the i3-gaps window manager (i3-gaps-wm), the i3lock-color screen locker, i3status (for system information) and suckless-tools (for dmenu). - These are all the tools you need to use the i3 window manager efficiently. + These are all the tools you need to use the i3-gaps window manager efficiently. -Package: i3-wm +Package: i3-gaps-wm Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends} Provides: x-window-manager Recommends: xfonts-base, fonts-dejavu-core, libanyevent-i3-perl (>= 0.12), libjson-xs-perl, rxvt-unicode | x-terminal-emulator Description: improved dynamic tiling window manager - Key features of i3 are good documentation, reasonable defaults (changeable in + Key features of i3-gaps are good documentation, reasonable defaults (changeable in a simple configuration file) and good multi-monitor support. The user - interface is designed for power users and emphasizes keyboard usage. i3 uses + interface is designed for power users and emphasizes keyboard usage. i3-gaps uses XCB for asynchronous communication with X11 and aims to be fast and light-weight. . - Please be aware i3 is primarily targeted at advanced users and developers. + Please be aware i3-gaps is primarily targeted at advanced users and developers. -Package: i3-wm-dbg +Package: i3-gaps-wm-dbg Architecture: any Section: debug -Depends: i3-wm (=${binary:Version}), ${misc:Depends} -Description: Debugging symbols for the i3 window manager - Debugging symbols for the i3 window manager. Please install this to produce +Depends: i3-gaps-wm (=${binary:Version}), ${misc:Depends} +Description: Debugging symbols for the i3-gaps window manager + Debugging symbols for the i3-gaps window manager. Please install this to produce useful backtraces before creating new tickets. diff --git a/debian/copyright b/debian/copyright index f80edad..5c6c02a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,41 +1,40 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: i3 -Upstream-Contact: Michael Stapelberg -Source: https://i3wm.org/ +Upstream-Name: i3-wm +Upstream-Contact: Ingo Bürk +Source: https://github.com/Airblader/i3 Files: * Copyright: 2009 Michael Stapelberg License: BSD-3-clause Files: debian/* -Copyright: 2009 Michael Stapelberg +Copyright: 2020 Joseph O'Gorman License: BSD-3-clause License: BSD-3-clause - Copyright: © 2009 Michael Stapelberg All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. . - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. . - * Neither the name of Michael Stapelberg, i3 nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. + * Neither the name of Michael Stapelberg nor the + names of contributors may be used to endorse or promote products + derived from this software without specific prior written permission. . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + THIS SOFTWARE IS PROVIDED BY Michael Stapelberg ''AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL Michael Stapelberg BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..d9115b4 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,10 @@ +[DEFAULT] +debian-branch = kali/master +debian-tag = kali/%(version)s +pristine-tar = True + +[pq] +patch-numbers = False + +[dch] +multimaint-merge = True diff --git a/debian/i3-gaps.doc-base b/debian/i3-gaps.doc-base new file mode 100644 index 0000000..f501466 --- /dev/null +++ b/debian/i3-gaps.doc-base @@ -0,0 +1,10 @@ +Document: i3-gaps +Title: i3 documentation +Author: Michael Stapelberg +Abstract: The documentation explains how to use and modify the i3 window + manager. +Section: Window Managers + +Format: HTML +Files: /usr/share/doc/i3-gaps/*.html +Index: /usr/share/doc/i3-gaps/userguide.html diff --git a/debian/i3-gaps.docs b/debian/i3-gaps.docs new file mode 100644 index 0000000..437175b --- /dev/null +++ b/debian/i3-gaps.docs @@ -0,0 +1,32 @@ +docs/debugging.html +docs/hacking-howto.html +docs/i3bar-protocol.html +docs/userguide.html +docs/bigpicture.png +docs/single_terminal.png +docs/snapping.png +docs/two_columns.png +docs/two_terminals.png +docs/modes.png +docs/ipc.html +docs/multi-monitor.html +docs/wsbar.html +docs/wsbar.png +docs/keyboard-layer1.png +docs/keyboard-layer2.png +docs/testsuite.html +docs/i3-sync-working.png +docs/i3-sync.png +docs/tree-layout1.png +docs/tree-layout2.png +docs/tree-shot1.png +docs/tree-shot2.png +docs/tree-shot3.png +docs/tree-shot4.png +docs/refcard.html +docs/refcard_style.css +docs/logo-30.png +docs/lib-i3test.html +docs/lib-i3test-test.html +docs/layout-saving.html +docs/layout-saving-1.png diff --git a/debian/i3-gaps.install b/debian/i3-gaps.install new file mode 100644 index 0000000..a0b1f17 --- /dev/null +++ b/debian/i3-gaps.install @@ -0,0 +1,7 @@ +debian/tmp/etc +debian/tmp/usr +contrib/dump-asy.pl usr/share/doc/i3-gaps/examples/ +contrib/gtk-tree-watch.pl usr/share/doc/i3-gaps/examples/ +contrib/i3-wsbar usr/share/doc/i3-gaps/examples/ +contrib/per-workspace-layout.pl usr/share/doc/i3-gaps/examples/ +contrib/trivial-bar-script.sh usr/share/doc/i3-gaps/examples/ diff --git a/debian/i3-gaps.links b/debian/i3-gaps.links new file mode 100644 index 0000000..376018b --- /dev/null +++ b/debian/i3-gaps.links @@ -0,0 +1 @@ +usr/share/man/man1/i3.1.gz usr/share/man/man1/i3-with-shmlog.1.gz diff --git a/debian/i3-gaps.manpages b/debian/i3-gaps.manpages new file mode 100644 index 0000000..1953b6a --- /dev/null +++ b/debian/i3-gaps.manpages @@ -0,0 +1,13 @@ +man/i3.1 +man/i3-msg.1 +man/i3-input.1 +man/i3-nagbar.1 +man/i3-config-wizard.1 +man/i3-dump-log.1 +man/i3-migrate-config-to-v4.1 +man/i3-sensible-pager.1 +man/i3-sensible-editor.1 +man/i3-sensible-terminal.1 +man/i3-dmenu-desktop.1 +man/i3-save-tree.1 +man/i3bar.1 diff --git a/debian/i3-gaps.wm b/debian/i3-gaps.wm new file mode 100644 index 0000000..179b073 --- /dev/null +++ b/debian/i3-gaps.wm @@ -0,0 +1 @@ +/usr/bin/i3 diff --git a/debian/i3-wm.doc-base b/debian/i3-wm.doc-base deleted file mode 100644 index 8e24720..0000000 --- a/debian/i3-wm.doc-base +++ /dev/null @@ -1,10 +0,0 @@ -Document: i3-wm -Title: i3 documentation -Author: Michael Stapelberg -Abstract: The documentation explains how to use and modify the i3 window - manager. -Section: Window Managers - -Format: HTML -Files: /usr/share/doc/i3-wm/*.html -Index: /usr/share/doc/i3-wm/userguide.html diff --git a/debian/i3-wm.docs b/debian/i3-wm.docs deleted file mode 100644 index 437175b..0000000 --- a/debian/i3-wm.docs +++ /dev/null @@ -1,32 +0,0 @@ -docs/debugging.html -docs/hacking-howto.html -docs/i3bar-protocol.html -docs/userguide.html -docs/bigpicture.png -docs/single_terminal.png -docs/snapping.png -docs/two_columns.png -docs/two_terminals.png -docs/modes.png -docs/ipc.html -docs/multi-monitor.html -docs/wsbar.html -docs/wsbar.png -docs/keyboard-layer1.png -docs/keyboard-layer2.png -docs/testsuite.html -docs/i3-sync-working.png -docs/i3-sync.png -docs/tree-layout1.png -docs/tree-layout2.png -docs/tree-shot1.png -docs/tree-shot2.png -docs/tree-shot3.png -docs/tree-shot4.png -docs/refcard.html -docs/refcard_style.css -docs/logo-30.png -docs/lib-i3test.html -docs/lib-i3test-test.html -docs/layout-saving.html -docs/layout-saving-1.png diff --git a/debian/i3-wm.install b/debian/i3-wm.install deleted file mode 100644 index 823d409..0000000 --- a/debian/i3-wm.install +++ /dev/null @@ -1,7 +0,0 @@ -debian/tmp/etc -debian/tmp/usr -contrib/dump-asy.pl usr/share/doc/i3-wm/examples/ -contrib/gtk-tree-watch.pl usr/share/doc/i3-wm/examples/ -contrib/i3-wsbar usr/share/doc/i3-wm/examples/ -contrib/per-workspace-layout.pl usr/share/doc/i3-wm/examples/ -contrib/trivial-bar-script.sh usr/share/doc/i3-wm/examples/ diff --git a/debian/i3-wm.links b/debian/i3-wm.links deleted file mode 100644 index 376018b..0000000 --- a/debian/i3-wm.links +++ /dev/null @@ -1 +0,0 @@ -usr/share/man/man1/i3.1.gz usr/share/man/man1/i3-with-shmlog.1.gz diff --git a/debian/i3-wm.manpages b/debian/i3-wm.manpages deleted file mode 100644 index 1953b6a..0000000 --- a/debian/i3-wm.manpages +++ /dev/null @@ -1,13 +0,0 @@ -man/i3.1 -man/i3-msg.1 -man/i3-input.1 -man/i3-nagbar.1 -man/i3-config-wizard.1 -man/i3-dump-log.1 -man/i3-migrate-config-to-v4.1 -man/i3-sensible-pager.1 -man/i3-sensible-editor.1 -man/i3-sensible-terminal.1 -man/i3-dmenu-desktop.1 -man/i3-save-tree.1 -man/i3bar.1 diff --git a/debian/i3-wm.wm b/debian/i3-wm.wm deleted file mode 100644 index 179b073..0000000 --- a/debian/i3-wm.wm +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/i3 diff --git a/debian/kali-ci.yml b/debian/kali-ci.yml new file mode 100644 index 0000000..058e396 --- /dev/null +++ b/debian/kali-ci.yml @@ -0,0 +1,2 @@ +include: + - https://gitlab.com/kalilinux/tools/kali-ci-pipeline/raw/master/recipes/kali.yml diff --git a/debian/rules b/debian/rules index d5c3068..396f2eb 100755 --- a/debian/rules +++ b/debian/rules @@ -8,14 +8,14 @@ dh_installchangelogs RELEASE-NOTES-* override_dh_strip: - dh_strip --dbg-package=i3-wm-dbg + dh_strip --dbg-package=i3-gaps-wm-dbg override_dh_auto_test: # TODO: enable tests override_dh_auto_configure: # The default is /usr/share/doc/i3 - dh_auto_configure -- --docdir=/usr/share/doc/i3-wm + dh_auto_configure -- --docdir=/usr/share/doc/i3-gaps override_dh_builddeb: # bintray does not support xz currently. diff --git a/debian/watch b/debian/watch index f434b2e..043b3af 100644 --- a/debian/watch +++ b/debian/watch @@ -1,3 +1,3 @@ -version=3 -opts=pgpsigurlmangle=s/$/.asc/ \ - https://i3wm.org/downloads/ /downloads/i3-(.*)\.tar\.bz2 +version=4 +https://github.com/Airblader/i3/tags \ + (?:.*?/)?i3-(\d[\d.]*)\.tar\.gz debian uupdate diff --git a/docs/debugging.html b/docs/debugging.html new file mode 100644 index 0000000..0315c34 --- /dev/null +++ b/docs/debugging.html @@ -0,0 +1,964 @@ + + + + + + +Debugging i3: How To + + + + + +
+
+
+

This document describes how to debug i3 to send us useful bug +reports, even if you have no knowledge of C programming.

+

Thank you for being interested in debugging i3. It really means +something to us to get your bug fixed. If you have any questions about the +process and/or need further help, do not hesitate to contact us!

+
+
+
+

1. Verify you are using i3 ≥ 4.10

+
+

Only the latest major version of i3 is supported. To verify which version +you are running, use:

+
+
+
$ i3 --moreversion 2>&- || i3 --version
+Binary i3 version:  4.7 (2013-12-22, branch "tags/4.7")
+Running i3 version: 4.7-84-gac74a63 (2014-01-01, branch "next") (pid 1995)
+
+

Your version can look like this:

+
+
+4.7 (release version) +
+
+

+You are using a release version. In many cases, bugs are already +fixed in the development version of i3. Even if the bug is not a known fixed +one, we will still ask you to reproduce your error with the most recent +development version of i3. Therefore, please upgrade to a development version +if you can. +

+
+
+4.7-85-g9c15b95 (development version) +
+
+

+Your version is 85 commits newer than 4.7, and the git revision of your +version is 9c15b95. Go to https://github.com/i3/i3/commits/next and see if +the most recent commit starts with the same revision. If so, you are using the +latest version. +

+
+
+

Development versions of i3 have logging enabled by default and are compiled +with debug symbols.

+
+
+
+

2. Enabling logging

+
+

If you are using a development version (see previous section), you don’t need +to do anything — skip to section 3.

+

If you are using a release version with a custom ~/.xsession (or xinitrc) +file, execute i3 with a line like this:

+
+
+
# Use 25 MiB of RAM for debug logs
+exec i3 --shmlog-size=26214400
+
+

If you are NOT using an ~/.xsession file but you just chose "i3" from the +list of sessions in your desktop manager (gdm, lxdm, …), edit +/usr/share/xsessions/i3.desktop and replace the Exec=i3 line with:

+
+
+
Exec=i3 --shmlog-size=26214400
+
+

If you cannot restart i3 for some reason, you can enable debug logging on the +fly:

+
+
+
i3-msg 'debuglog on; shmlog on; reload'
+
+
+
+
+

3. Reproducing the problem

+
+

Before submitting an issue, please make sure to close down on the problem as +much as you can yourself. Here are some steps you should consider:

+
    +
  • +

    +Find a deterministic, reliable way to reproduce the problem and provide it + with your bug report. +

    +
  • +
  • +

    +Try using the default i3 config to reproduce the problem. If the issue does + not appear with the default config, gradually adapt it to track down what + change(s) to the config introduce the problem. +

    +
  • +
  • +

    +Reproduce the problem with a minimal setup, i.e., only use as few applications, + windows and steps as necessary. +

    +
  • +
  • +

    +In addition, try to stick to applications that are common and, even more + importantly, free / open source. +

    +
  • +
  • +

    +Before obtaining the log file, restart i3 in-place, execute the steps to + reproduce the problem and then save the logs. This keeps the log file as + small as possible and necessary. +

    +
  • +
+

Please be aware that we cannot support compatibility issues with closed-source +software, as digging into compatibility problems without having access to the +source code is too time-consuming. Additionally, experience has shown that +often, the software in question is responsible for the issue. Please raise an +issue with the software in question, not i3.

+
+
+
+

4. Obtaining the debug logfile

+
+
+ + + +
+
Caution
+
+

Logs may contain sensitive information, so please inspect the log before +submitting it. Logs may be viewed by anyone, once posted. If you choose to +redact the log, make an effort not to discard information which may be relevant +to the issue you are reporting.

+

The best way to avoid submitting such information is to only run the necessary +steps to reproduce the behavior when saving the log file. This will also make +analyzing the log file easier.

+
+
+

No matter whether i3 misbehaved in some way without crashing or whether it just +crashed, the logfile provides all information necessary to debug the problem.

+

To upload a compressed version of the logfile (for a bugreport), use:

+
+
+
DISPLAY=:0 i3-dump-log | bzip2 -c | curl --data-binary @- https://logs.i3wm.org
+
+

This command does not depend on i3 (it also works while i3 displays +the crash dialog), but it requires a working X11 connection.

+

After running it, you will get a URL to the logfile. Please include that URL in +your bug report.

+
+
+
+

5. On crashes: Obtaining a backtrace

+
+

When i3 crashes, it will display a dialog stating “i3 just crashed”, offering +you to save a backtrace to a text file.

+

To actually get useful backtraces, you should make sure that your version of i3 +is compiled with debug symbols:

+
+
+
$ file `which i3`
+/usr/bin/i3: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically
+linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
+
+

Notice the not stripped, which is the important part. If you have a version +which is stripped, please check whether your distribution provides debug +symbols (package i3-wm-dbg on Debian for example) or if you can turn off +stripping. If nothing helps, please build i3 from source.

+

Once you have made sure that your i3 is compiled with debug symbols and the C +debugger gdb is installed on your machine, you can let i3 generate a +backtrace in the crash dialog.

+

After pressing "b" in the crash dialog, you will get a file called +/tmp/i3-backtrace.%d.%d.txt where the first %d is replaced by i3’s process +id (PID) and the second one is incremented each time you generate a backtrace, +starting at 0.

+
+
+
+

6. Sending bug reports/debugging on IRC

+
+

When sending bug reports, please attach the whole log file. Even if you think +you found the section which clearly highlights the problem, additional +information might be necessary to completely diagnose the problem.

+

When debugging with us in IRC, be prepared to use a so-called nopaste service +such as https://pastebin.com because pasting large amounts of text in IRC +sometimes leads to incomplete lines (servers have line length limitations) or +flood kicks.

+
+
+
+

7. Debugging i3bar

+
+

To debug i3bar problems, use the --verbose commandline parameter, +or add verbose yes to all bar {} blocks in your i3 +config, reload your config and then restart all i3bar instances like this:

+
+
+
$ i3 reload
+$ killall i3bar
+$ for c in $(i3-msg -t get_bar_config | python -c \
+      'import json,sys;print("\n".join(json.load(sys.stdin)))'); do \
+    (i3bar --bar_id=$c >i3bar.$c.log 2>&1) & \
+  done;
+
+

There will now be i3bar.*.log files in your current directory that you can provide +in your bug report.

+
+
+
+

+ + + diff --git a/docs/hacking-howto.html b/docs/hacking-howto.html new file mode 100644 index 0000000..8f0f867 --- /dev/null +++ b/docs/hacking-howto.html @@ -0,0 +1,2388 @@ + + + + + + +Hacking i3: How To + + + + + +
+
+
+

This document is intended to be the first thing you read before looking and/or +touching i3’s source code. It should contain all important information to help +you understand why things are like they are. If it does not mention something +you find necessary, please do not hesitate to contact me.

+
+
+
+

1. Building i3

+
+

You can build i3 like you build any other software package which uses autotools. +Here’s a memory refresher:

+
+
+
$ autoreconf -fi
+$ mkdir -p build && cd build
+$ ../configure
+$ make -j8
+
+

(The autoreconf -fi step is unnecessary if you are building from a release tarball, + but shouldn’t hurt either.)

+
+

1.1. Build system features

+
    +
  • +

    +We use the AX_ENABLE_BUILDDIR macro to enforce builds happening in a separate + directory. This is a prerequisite for the AX_EXTEND_SRCDIR macro and building + in a separate directory is common practice anyway. In case this causes any + trouble when packaging i3 for your distribution, please open an issue. +

    +
  • +
  • +

    +“make check” runs the i3 testsuite. See docs/testsuite for details. +

    +
  • +
  • +

    +“make distcheck” (runs testsuite on “make dist” result, tiny bit quicker + feedback cycle than waiting for the travis build to catch the issue). +

    +
  • +
  • +

    +“make uninstall” (occasionally requested by users who compile from source) +

    +
  • +
  • +

    +“make” will build manpages/docs by default if the tools are installed. + Conversely, manpages/docs are not tried to be built for users who don’t want + to install all these dependencies to get started hacking on i3. +

    +
  • +
  • +

    +non-release builds will enable address sanitizer by default. Use the + --disable-sanitizers configure option to turn off all sanitizers, and see + --help for available sanitizers. +

    +
  • +
  • +

    +Support for pre-compiled headers (PCH) has been dropped for now in the + interest of simplicity. If you need support for PCH, please open an issue. +

    +
  • +
  • +

    +Coverage reports are now generated using “make check-code-coverage”, which + requires specifying --enable-code-coverage when calling configure. +

    +
  • +
+
+
+
+
+

2. Using git / sending patches

+
+ +

Please talk to us before working on new features to see whether they will be +accepted. A good way for this is to open an issue and asking for opinions on it. +Even for accepted features, this can be a good way to refine an idea upfront. However, +we don’t want to see certain features in i3, e.g., switching window focus in an +Alt+Tab like way.

+

When working on bugfixes, please make sure you mention that you are working on +it in the corresponding bug report at https://github.com/i3/i3/issues. In case +there is no bug report yet, please create one.

+

After you are done, please submit your work for review as a pull request at +https://github.com/i3/i3.

+

Do not send emails to the mailing list or any author directly, and don’t submit +them in the bugtracker, since all reviews should be done in public at +https://github.com/i3/i3. In order to make your review go as fast as possible, you +could have a look at previous reviews and see what the common mistakes are.

+
+

2.1. Which branch to use?

+

Work on i3 generally happens in two branches: “master” and “next” (the latter +being the default branch, the one that people get when they check out the git +repository).

+

The contents of “master” are always stable. That is, it contains the source code +of the latest release, plus any bugfixes that were applied since that release.

+

New features are only found in the “next” branch. Therefore, if you are working +on a new feature, use the “next” branch. If you are working on a bugfix, use the +“next” branch, too, but make sure your code also works on “master”.

+
+
+
+
+

3. Window Managers

+
+

A window manager is not necessarily needed to run X, but it is usually used in +combination with X to facilitate some things. The window manager’s job is to +take care of the placement of windows, to provide the user with some mechanisms +to change the position/size of windows and to communicate with clients to a +certain extent (for example handle fullscreen requests of clients such as +MPlayer).

+

There are no different contexts in which X11 clients run, so a window manager +is just another client, like all other X11 applications. However, it handles +some events which normal clients usually don’t handle.

+

In the case of i3, the tasks (and order of them) are the following:

+
    +
  1. +

    +Grab the key bindings (events will be sent upon keypress/keyrelease) +

    +
  2. +
  3. +

    +Iterate through all existing windows (if the window manager is not started as + the first client of X) and manage them (reparent them, create window + decorations, etc.) +

    +
  4. +
  5. +

    +When new windows are created, manage them +

    +
  6. +
  7. +

    +Handle the client’s _WM_STATE property, but only _WM_STATE_FULLSCREEN and + _NET_WM_STATE_DEMANDS_ATTENTION +

    +
  8. +
  9. +

    +Handle the client’s WM_NAME property +

    +
  10. +
  11. +

    +Handle the client’s size hints to display them proportionally +

    +
  12. +
  13. +

    +Handle the client’s urgency hint +

    +
  14. +
  15. +

    +Handle enter notifications (focus follows mouse) +

    +
  16. +
  17. +

    +Handle button (as in mouse buttons) presses for focus/raise on click +

    +
  18. +
  19. +

    +Handle expose events to re-draw own windows such as decorations +

    +
  20. +
  21. +

    +React to the user’s commands: Change focus, Move windows, Switch workspaces, + Change the layout mode of a container (default/stacking/tabbed), start a new + application, restart the window manager +

    +
  22. +
+

In the following chapters, each of these tasks and their implementation details +will be discussed.

+
+

3.1. Tiling window managers

+

Traditionally, there are two approaches to managing windows: The most common +one nowadays is floating, which means the user can freely move/resize the +windows. The other approach is called tiling, which means that your window +manager distributes windows to use as much space as possible while not +overlapping each other.

+

The idea behind tiling is that you should not need to waste your time +moving/resizing windows while you usually want to get some work done. After +all, most users sooner or later tend to lay out their windows in a way which +corresponds to tiling or stacking mode in i3. Therefore, why not let i3 do this +for you? Certainly, it’s faster than you could ever do it.

+

The problem with most tiling window managers is that they are too inflexible. +In my opinion, a window manager is just another tool, and similar to vim which +can edit all kinds of text files (like source code, HTML, …) and is not limited +to a specific file type, a window manager should not limit itself to a certain +layout (like dwm, awesome, …) but provide mechanisms for you to easily create +the layout you need at the moment.

+
+
+

3.2. The layout tree

+

The data structure which i3 uses to keep track of your windows is a tree. Every +node in the tree is a container (type Con). Some containers represent actual +windows (every container with a window != NULL), some represent split +containers and a few have special purposes: they represent workspaces, outputs +(like VGA1, LVDS1, …) or the X11 root window.

+

So, when you open a terminal and immediately open another one, they reside in +the same split container, which uses the default layout. In case of an empty +workspace, the split container we are talking about is the workspace.

+

To get an impression of how different layouts are represented, just play around +and look at the data structures — they are exposed as a JSON hash. See +https://i3wm.org/docs/ipc.html#_tree_reply for documentation on that and an +example.

+
+
+
+
+

4. Files

+
+
+
+include/atoms.xmacro +
+
+

+A file containing all X11 atoms which i3 uses. This file will be included +various times (for defining, requesting and receiving the atoms), each time +with a different definition of xmacro(). +

+
+
+include/data.h +
+
+

+Contains data definitions used by nearly all files. You really need to read +this first. +

+
+
+include/*.h +
+
+

+Contains forward definitions for all public functions, as well as +doxygen-compatible comments (so if you want to get a bit more of the big +picture, either browse all header files or use doxygen if you prefer that). +

+
+
+src/config_parser.c +
+
+

+Contains a custom configuration parser. See src/command_parser.c for rationale + on why we use a custom parser. +

+
+
+src/click.c +
+
+

+Contains all functions which handle mouse button clicks (right mouse button +clicks initiate resizing and thus are relatively complex). +

+
+
+src/command_parser.c +
+
+

+Contains a hand-written parser to parse commands (commands are what +you bind on keys and what you can send to i3 using the IPC interface, like +move left or workspace 4). +

+
+
+src/con.c +
+
+

+Contains all functions which deal with containers directly (creating +containers, searching containers, getting specific properties from containers, +…). +

+
+
+src/config.c +
+
+

+Contains all functions handling the configuration file (calling the parser +src/config_parser.c) with the correct path, switching key bindings mode). +

+
+
+src/ewmh.c +
+
+

+Functions to get/set certain EWMH properties easily. +

+
+
+src/floating.c +
+
+

+Contains functions for floating mode (mostly resizing/dragging). +

+
+
+src/handlers.c +
+
+

+Contains all handlers for all kinds of X events (new window title, new hints, +unmapping, key presses, button presses, …). +

+
+
+src/ipc.c +
+
+

+Contains code for the IPC interface. +

+
+
+src/load_layout.c +
+
+

+Contains code for loading layouts from JSON files. +

+
+
+src/log.c +
+
+

+Contains the logging functions. +

+
+
+src/main.c +
+
+

+Initializes the window manager. +

+
+
+src/manage.c +
+
+

+Looks at existing or new windows and decides whether to manage them. If so, it +reparents the window and inserts it into our data structures. +

+
+
+src/match.c +
+
+

+A "match" is a data structure which acts like a mask or expression to match +certain windows or not. For example, when using commands, you can specify a +command like this: [title="Firefox"] kill. The title member of the match +data structure will then be filled and i3 will check each window using +match_matches_window() to find the windows affected by this command. +

+
+
+src/move.c +
+
+

+Contains code to move a container in a specific direction. +

+
+
+src/output.c +
+
+

+Functions to handle CT_OUTPUT cons. +

+
+
+src/randr.c +
+
+

+The RandR API is used to get (and re-query) the configured outputs (monitors, +…). +

+
+
+src/render.c +
+
+

+Renders the tree data structure by assigning coordinates to every node. These +values will later be pushed to X11 in src/x.c. +

+
+
+src/resize.c +
+
+

+Contains the functions to resize containers. +

+
+
+src/restore_layout.c +
+
+

+Everything for restored containers that is not pure state parsing (which can be +found in load_layout.c). +

+
+
+src/sighandler.c +
+
+

+Handles SIGSEGV, SIGABRT and SIGFPE by showing a dialog that i3 crashed. +You can chose to let it dump core, to restart it in-place or to restart it +in-place but forget about the layout. +

+
+
+src/tree.c +
+
+

+Contains functions which open or close containers in the tree, change focus or +cleanup ("flatten") the tree. See also src/move.c for another similar +function, which was moved into its own file because it is so long. +

+
+
+src/util.c +
+
+

+Contains useful functions which are not really dependent on anything. +

+
+
+src/window.c +
+
+

+Handlers to update X11 window properties like WM_CLASS, _NET_WM_NAME, +CLIENT_LEADER, etc. +

+
+
+src/workspace.c +
+
+

+Contains all functions related to workspaces (displaying, hiding, renaming…) +

+
+
+src/x.c +
+
+

+Transfers our in-memory tree (see src/render.c) to X11. +

+
+
+src/xcb.c +
+
+

+Contains wrappers to use xcb more easily. +

+
+
+src/xcursor.c +
+
+

+XCursor functions (for cursor themes). +

+
+
+src/xinerama.c +
+
+

+Legacy support for Xinerama. See src/randr.c for the preferred API. +

+
+
+
+
+
+

5. Data structures

+
+

See include/data.h for documented data structures. The most important ones are +explained right here.

+

So, the hierarchy is:

+
    +
  1. +

    +X11 root window, the root container +

    +
  2. +
  3. +

    +Output container (LVDS1 in this example) +

    +
  4. +
  5. +

    +Content container (there are also containers for dock windows) +

    +
  6. +
  7. +

    +Workspaces (Workspace 1 in this example, with horizontal orientation) +

    +
  8. +
  9. +

    +Split container (vertically split) +

    +
  10. +
  11. +

    +X11 window containers +

    +
  12. +
+

The data type is Con, in all cases.

+
+

5.1. X11 root window

+

The X11 root window is a single window per X11 display (a display is identified +by :0 or :1 etc.). The root window is what you draw your background image +on. It spans all the available outputs, e.g. VGA1 is a specific part of the +root window and LVDS1 is a specific part of the root window.

+
+
+

5.2. Output container

+

Every active output obtained through RandR is represented by one output +container. Outputs are considered active when a mode is configured (meaning +something is actually displayed on the output) and the output is not a clone.

+

For example, if your notebook has a screen resolution of 1280x800 px and you +connect a video projector with a resolution of 1024x768 px, set it up in clone +mode (xrandr --output VGA1 --mode 1024x768 --same-as LVDS1), i3 will +reduce the resolution to the lowest common resolution and disable one of the +cloned outputs afterwards.

+

However, if you configure it using xrandr --output VGA1 --mode 1024x768 +--right-of LVDS1, i3 will set both outputs active. For each output, a new +workspace will be assigned. New workspaces are created on the output you are +currently on.

+
+
+

5.3. Content container

+

Each output has multiple children. Two of them are dock containers which hold +dock clients. The other one is the content container, which holds the actual +content (workspaces) of this output.

+
+
+

5.4. Workspace

+

A workspace is identified by its name. Basically, you could think of +workspaces as different desks in your office, if you like the desktop +metaphor. They just contain different sets of windows and are completely +separate of each other. Other window managers also call this “Virtual +desktops”.

+
+
+

5.5. Split container

+

A split container is a container which holds an arbitrary amount of split +containers or X11 window containers. It has an orientation (horizontal or +vertical) and a layout.

+

Split containers (and X11 window containers, which are a subtype of split +containers) can have different border styles.

+
+
+

5.6. X11 window container

+

An X11 window container holds exactly one X11 window. These are the leaf nodes +of the layout tree, they cannot have any children.

+
+
+
+
+

6. List/queue macros

+
+

i3 makes heavy use of the list macros defined in BSD operating systems. To +ensure that the operating system on which i3 is compiled has all the expected +features, i3 comes with include/queue.h. On BSD systems, you can use man +queue(3). On Linux, you have to use google (or read the source).

+

The lists used are SLIST (single linked lists), CIRCLEQ (circular +queues) and TAILQ (tail queues). Usually, only forward traversal is necessary, +so an SLIST works fine. If inserting elements at arbitrary positions or at +the end of a list is necessary, a TAILQ is used instead. However, for the +windows inside a container, a CIRCLEQ is necessary to go from the currently +selected window to the window above/below.

+
+
+
+

7. Naming conventions

+
+

There is a row of standard variables used in many events. The following names +should be chosen for those:

+
    +
  • +

    +“conn” is the xcb_connection_t +

    +
  • +
  • +

    +“event” is the event of the particular type +

    +
  • +
  • +

    +“con” names a container +

    +
  • +
  • +

    +“current” is a loop variable when using TAILQ_FOREACH etc. +

    +
  • +
+
+
+
+

8. Startup (src/mainx.c, main())

+
+
    +
  • +

    +Establish the xcb connection +

    +
  • +
  • +

    +Check for XKB extension on the separate X connection, load Xcursor +

    +
  • +
  • +

    +Check for RandR screens (with a fall-back to Xinerama) +

    +
  • +
  • +

    +Grab the keycodes for which bindings exist +

    +
  • +
  • +

    +Manage all existing windows +

    +
  • +
  • +

    +Enter the event loop +

    +
  • +
+
+
+
+

9. Keybindings

+
+
+

9.1. Grabbing the bindings

+

Grabbing the bindings is quite straight-forward. You pass X your combination of +modifiers and the keycode you want to grab and whether you want to grab them +actively or passively. Most bindings (everything except for bindings using +Mode_switch) are grabbed passively, that is, just the window manager gets the +event and cannot replay it.

+

We need to grab bindings that use Mode_switch actively because of a bug in X. +When the window manager receives the keypress/keyrelease event for an actively +grabbed keycode, it has to decide what to do with this event: It can either +replay it so that other applications get it or it can prevent other +applications from receiving it.

+

So, why do we need to grab keycodes actively? Because X does not set the +state-property of keypress/keyrelease events properly. The Mode_switch bit is +not set and we need to get it using XkbGetState. This means we cannot pass X +our combination of modifiers containing Mode_switch when grabbing the key and +therefore need to grab the keycode itself without any modifiers. This means, +if you bind Mode_switch + keycode 38 ("a"), i3 will grab keycode 38 ("a") and +check on each press of "a" if the Mode_switch bit is set using XKB. If yes, it +will handle the event, if not, it will replay the event.

+
+
+

9.2. Handling a keypress

+

As mentioned in "Grabbing the bindings", upon a keypress event, i3 first gets +the correct state.

+

Then, it looks through all bindings and gets the one which matches the received +event.

+

The bound command is parsed by the cmdparse lexer/parser, see parse_cmd in +src/cmdparse.y.

+
+
+
+
+

10. Manage windows (src/main.c, manage_window() and reparent_window())

+
+

manage_window() does some checks to decide whether the window should be +managed at all:

+
    +
  • +

    +Windows have to be mapped, that is, visible on screen +

    +
  • +
  • +

    +The override_redirect must not be set. Windows with override_redirect shall + not be managed by a window manager +

    +
  • +
+

Afterwards, i3 gets the initial geometry and reparents the window (see +reparent_window()) if it wasn’t already managed.

+

Reparenting means that for each window which is reparented, a new window, +slightly larger than the original one, is created. The original window is then +reparented to the bigger one (called "frame").

+

After reparenting, the window type (_NET_WM_WINDOW_TYPE) is checked to see +whether this window is a dock (_NET_WM_WINDOW_TYPE_DOCK), like dzen2 for +example. Docks are handled differently, they don’t have decorations and are not +assigned to a specific container. Instead, they are positioned at the bottom +or top of the screen (in the appropriate dock area containers). To get the +height which needs to be reserved for the window, the _NET_WM_STRUT_PARTIAL +property is used.

+

Furthermore, the list of assignments (to other workspaces, which may be on +other screens) is checked. If the window matches one of the user’s criteria, +it may either be put in floating mode or moved to a different workspace. If the +target workspace is not visible, the window will not be mapped.

+
+
+
+

11. What happens when an application is started?

+
+

i3 does not care about applications. All it notices is when new windows are +mapped (see src/handlers.c, handle_map_request()). The window is then +reparented (see section "Manage windows").

+

After reparenting the window, render_tree() is called which renders the +internal layout table. The new window has been placed in the currently focused +container and therefore the new window and the old windows (if any) need to be +moved/resized so that the currently active layout (default/stacking/tabbed mode) +is rendered correctly. To move/resize windows, a window is “configured” in +X11-speak.

+

Some applications, such as MPlayer obviously assume the window manager is +stupid and try to configure their windows by themselves. This generates an +event called configurerequest. i3 handles these events and tells the window the +size it had before the configurerequest (with the exception of not yet mapped +windows, which get configured like they want to, and floating windows, which +can reconfigure themselves).

+
+
+
+

12. _NET_WM_STATE

+
+

Only the _NET_WM_STATE_FULLSCREEN and _NET_WM_STATE_DEMANDS_ATTENTION atoms +are handled.

+

The former calls “toggle_fullscreen()” for the specific client which just +configures the client to use the whole screen on which it currently is. +Also, it is set as fullscreen_client for the i3Screen.

+

The latter is used to set, read and display urgency hints.

+
+
+
+

13. WM_NAME

+
+

When the WM_NAME property of a window changes, its decoration (containing the +title) is re-rendered. Note that WM_NAME is in COMPOUND_TEXT encoding which is +totally uncommon and cumbersome. Therefore, the _NET_WM_NAME atom will be used +if present.

+
+
+
+

14. _NET_WM_NAME

+
+

Like WM_NAME, this atom contains the title of a window. However, _NET_WM_NAME +is encoded in UTF-8. i3 will recode it to UCS-2 in order to be able to pass it +to X. Using an appropriate font (ISO-10646), you can see most special +characters (every special character contained in your font).

+
+
+
+

15. Size hints

+
+

Size hints specify the minimum/maximum size for a given window as well as its +aspect ratio. This is important for clients like mplayer, who only set the +aspect ratio and resize their window to be as small as possible (but only with +some video outputs, for example in Xv, while when using x11, mplayer does the +necessary centering for itself).

+

So, when an aspect ratio was specified, i3 adjusts the height of the window +until the size maintains the correct aspect ratio. For the code to do this, see +src/layout.c, function resize_client().

+
+
+
+

16. Rendering (src/layout.c, render_layout() and render_container())

+
+

Rendering in i3 version 4 is the step which assigns the correct sizes for +borders, decoration windows, child windows and the stacking order of all +windows. In a separate step (x_push_changes()), these changes are pushed to +X11.

+

Keep in mind that all these properties (rect, window_rect and deco_rect) +are temporary, meaning they will be overwritten by calling render_con. +Persistent position/size information is kept in geometry.

+

The entry point for every rendering operation (except for the case of moving +floating windows around) currently is tree_render() which will re-render +everything that’s necessary (for every output, only the currently displayed +workspace is rendered). This behavior is expected to change in the future, +since for a lot of updates, re-rendering everything is not actually necessary. +Focus was on getting it working correct, not getting it work very fast.

+

What tree_render() actually does is calling render_con() on the root +container and then pushing the changes to X11. The following sections talk +about the different rendering steps, in the order of "top of the tree" (root +container) to the bottom.

+
+

16.1. Rendering the root container

+

The i3 root container (con->type == CT_ROOT) represents the X11 root window. +It contains one child container for every output (like LVDS1, VGA1, …), which +is available on your computer.

+

Rendering the root will first render all tiling windows and then all floating +windows. This is necessary because a floating window can be positioned in such +a way that it is visible on two different outputs. Therefore, by first +rendering all the tiling windows (of all outputs), we make sure that floating +windows can never be obscured by tiling windows.

+

Essentially, though, this code path will just call render_con() for every +output and x_raise_con(); render_con() for every floating window.

+

In the special case of having a "global fullscreen" window (fullscreen mode +spanning all outputs), a shortcut is taken and x_raise_con(); render_con() is +only called for the global fullscreen window.

+
+
+

16.2. Rendering an output

+

Output containers (con->layout == L_OUTPUT) represent a hardware output like +LVDS1, VGA1, etc. An output container has three children (at the moment): One +content container (having workspaces as children) and the top/bottom dock area +containers.

+

The rendering happens in the function render_l_output() in the following +steps:

+
    +
  1. +

    +Find the content container (con->type == CT_CON) +

    +
  2. +
  3. +

    +Get the currently visible workspace (con_get_fullscreen_con(content, + CF_OUTPUT)). +

    +
  4. +
  5. +

    +If there is a fullscreened window on that workspace, directly render it and + return, thus ignoring the dock areas. +

    +
  6. +
  7. +

    +Sum up the space used by all the dock windows (they have a variable height + only). +

    +
  8. +
  9. +

    +Set the workspace rects (x/y/width/height) based on the position of the + output (stored in con->rect) and the usable space + (con->rect.{width,height} without the space used for dock windows). +

    +
  10. +
  11. +

    +Recursively raise and render the output’s child containers (meaning dock + area containers and the content container). +

    +
  12. +
+
+
+

16.3. Rendering a workspace or split container

+

From here on, there really is no difference anymore. All containers are of +con->type == CT_CON (whether workspace or split container) and some of them +have a con->window, meaning they represent an actual window instead of a +split container.

+
+

16.3.1. Default layout

+

In default layout, containers are placed horizontally or vertically next to +each other (depending on the con->orientation). If a child is a leaf node (as +opposed to a split container) and has border style "normal", appropriate space +will be reserved for its window decoration.

+
+
+

16.3.2. Stacked layout

+

In stacked layout, only the focused window is actually shown (this is achieved +by calling x_raise_con() in reverse focus order at the end of render_con()).

+

The available space for the focused window is the size of the container minus +the height of the window decoration for all windows inside this stacked +container.

+

If border style is "1pixel" or "none", no window decoration height will be +reserved (or displayed later on), unless there is more than one window inside +the stacked container.

+
+
+

16.3.3. Tabbed layout

+

Tabbed layout works precisely like stacked layout, but the window decoration +position/size is different: They are placed next to each other on a single line +(fixed height).

+
+
+

16.3.4. Dock area layout

+

This is a special case. Users cannot choose the dock area layout, but it will be +set for the dock area containers. In the dockarea layout (at the moment!), +windows will be placed above each other.

+
+
+
+

16.4. Rendering a window

+

A window’s size and position will be determined in the following way:

+
    +
  1. +

    +Subtract the border if border style is not "none" (but "normal" or "1pixel"). +

    +
  2. +
  3. +

    +Subtract the X11 border, if the window has an X11 border > 0. +

    +
  4. +
  5. +

    +Obey the aspect ratio of the window (think MPlayer). +

    +
  6. +
  7. +

    +Obey the height- and width-increments of the window (think terminal emulator + which can only be resized in one-line or one-character steps). +

    +
  8. +
+
+
+
+
+

17. Pushing updates to X11 / Drawing

+
+

A big problem with i3 before version 4 was that we just sent requests to X11 +anywhere in the source code. This was bad because nobody could understand the +entirety of our interaction with X11, it lead to subtle bugs and a lot of edge +cases which we had to consider all over again.

+

Therefore, since version 4, we have a single file, src/x.c, which is +responsible for repeatedly transferring parts of our tree datastructure to X11.

+

src/x.c consists of multiple parts:

+
    +
  1. +

    +The state pushing: x_push_changes(), which calls x_push_node(). +

    +
  2. +
  3. +

    +State modification functions: x_con_init, x_reinit, + x_reparent_child, x_move_win, x_con_kill, x_raise_con, x_set_name + and x_set_warp_to. +

    +
  4. +
  5. +

    +Expose event handling (drawing decorations): x_deco_recurse() and + x_draw_decoration(). +

    +
  6. +
+
+

17.1. Pushing state to X11

+

In general, the function x_push_changes should be called to push state +changes. Only when the scope of the state change is clearly defined (for +example only the title of a window) and its impact is known beforehand, one can +optimize this and call x_push_node on the appropriate con directly.

+

x_push_changes works in the following steps:

+
    +
  1. +

    +Clear the eventmask for all mapped windows. This leads to not getting + useless ConfigureNotify or EnterNotify events which are caused by our + requests. In general, we only want to handle user input. +

    +
  2. +
  3. +

    +Stack windows above each other, in reverse stack order (starting with the + most obscured/bottom window). This is relevant for floating windows which + can overlap each other, but also for tiling windows in stacked or tabbed + containers. We also update the _NET_CLIENT_LIST_STACKING hint which is + necessary for tab drag and drop in Chromium. +

    +
  4. +
  5. +

    +x_push_node will be called for the root container, recursively calling + itself for the container’s children. This function actually pushes the + state, see the next paragraph. +

    +
  6. +
  7. +

    +If the pointer needs to be warped to a different position (for example when + changing focus to a different output), it will be warped now. +

    +
  8. +
  9. +

    +The eventmask is restored for all mapped windows. +

    +
  10. +
  11. +

    +Window decorations will be rendered by calling x_deco_recurse on the root + container, which then recursively calls itself for the children. +

    +
  12. +
  13. +

    +If the input focus needs to be changed (because the user focused a different + window), it will be updated now. +

    +
  14. +
  15. +

    +x_push_node_unmaps will be called for the root container. This function + only pushes UnmapWindow requests. Separating the state pushing is necessary + to handle fullscreen windows (and workspace switches) in a smooth fashion: + The newly visible windows should be visible before the old windows are + unmapped. +

    +
  16. +
+

x_push_node works in the following steps:

+
    +
  1. +

    +Update the window’s WM_NAME, if changed (the WM_NAME is set on i3 + containers mainly for debugging purposes). +

    +
  2. +
  3. +

    +Reparents a child window into the i3 container if the container was created + for a specific managed window. +

    +
  4. +
  5. +

    +If the size/position of the i3 container changed (due to opening a new + window or switching layouts for example), the window will be reconfigured. + Also, the pixmap which is used to draw the window decoration/border on is + reconfigured (pixmaps are size-dependent). +

    +
  6. +
  7. +

    +Size/position for the child window is adjusted. +

    +
  8. +
  9. +

    +The i3 container is mapped if it should be visible and was not yet mapped. + When mapping, WM_STATE is set to WM_STATE_NORMAL. Also, the eventmask of + the child window is updated and the i3 container’s contents are copied from + the pixmap. +

    +
  10. +
  11. +

    +x_push_node is called recursively for all children of the current + container. +

    +
  12. +
+

x_push_node_unmaps handles the remaining case of an i3 container being +unmapped if it should not be visible anymore. WM_STATE will be set to +WM_STATE_WITHDRAWN.

+
+
+

17.2. Drawing window decorations/borders/backgrounds

+

x_draw_decoration draws window decorations. It is run for every leaf +container (representing an actual X11 window) and for every non-leaf container +which is in a stacked/tabbed container (because stacked/tabbed containers +display a window decoration for split containers, which consists of a representation +of the child container’s names.

+

Then, parameters are collected to be able to determine whether this decoration +drawing is actually necessary or was already done. This saves a substantial +number of redraws (depending on your workload, but far over 50%).

+

Assuming that we need to draw this decoration, we start by filling the empty +space around the child window (think of MPlayer with a specific aspect ratio) +in the user-configured client background color.

+

Afterwards, we draw the appropriate border (in case of border styles "normal" +and "1pixel") and the top bar (in case of border style "normal").

+

The last step is drawing the window title on the top bar.

+
+
+
+
+

18. User commands (parser-specs/commands.spec)

+
+

In the configuration file and when using i3 interactively (with i3-msg, for +example), you use commands to make i3 do things, like focus a different window, +set a window to fullscreen, and so on. An example command is floating enable, +which enables floating mode for the currently focused window. See the +appropriate section in the User’s Guide for a reference of +all commands.

+

In earlier versions of i3, interpreting these commands was done using lex and +yacc, but experience has shown that lex and yacc are not well suited for our +command language. Therefore, starting from version 4.2, we use a custom parser +for user commands and the configuration file. +The input specification for this parser can be found in the file +parser-specs/*.spec. Should you happen to use Vim as an editor, use +:source parser-specs/highlighting.vim to get syntax highlighting for this file +(highlighting files for other editors are welcome).

+
+
Excerpt from commands.spec
+
+
state INITIAL:
+  '[' -> call cmd_criteria_init(); CRITERIA
+  'move' -> MOVE
+  'exec' -> EXEC
+  'workspace' -> WORKSPACE
+  'exit' -> call cmd_exit()
+  'restart' -> call cmd_restart()
+  'reload' -> call cmd_reload()
+
+

The input specification is written in an extremely simple format. The +specification is then converted into C code by the Perl script +generate-commands-parser.pl (the output file names begin with GENERATED and the +files are stored in the include directory). The parser implementation +src/commands_parser.c includes the generated C code at compile-time.

+

The above excerpt from commands.spec illustrates nearly all features of our +specification format: You describe different states and what can happen within +each state. State names are all-caps; the state in the above excerpt is called +INITIAL. A list of tokens and their actions (separated by an ASCII arrow) +follows. In the excerpt, all tokens are literals, that is, simple text strings +which will be compared with the input. An action is either the name of a state +in which the parser will transition into, or the keyword call, followed by +the name of a function (and optionally a state).

+
+

18.1. Example: The WORKSPACE state

+

Let’s have a look at the WORKSPACE state, which is a good example of all +features. This is its definition:

+
+
WORKSPACE state (commands.spec)
+
+
# workspace next|prev|next_on_output|prev_on_output
+# workspace back_and_forth
+# workspace <name>
+# workspace number <number>
+state WORKSPACE:
+  direction = 'next_on_output', 'prev_on_output', 'next', 'prev'
+      -> call cmd_workspace($direction)
+  'back_and_forth'
+      -> call cmd_workspace_back_and_forth()
+  'number'
+      -> WORKSPACE_NUMBER
+  workspace = string
+      -> call cmd_workspace_name($workspace)
+
+

As you can see from the commands, there are multiple different valid variants +of the workspace command:

+
+
+workspace <direction> +
+
+

+ The word workspace can be followed by any of the tokens next, + prev, next_on_output or prev_on_output. This command will + switch to the next or previous workspace (optionally on the same + output).
+ There is one function called cmd_workspace, which is defined + in src/commands.c. It will handle this kind of command. To know which + direction was specified, the direction token is stored on the stack + with the name "direction", which is what the "direction = " means in + the beginning.
+

+
+
+
+ + + +
+
Note
+
Note that you can specify multiple literals in the same line. This has + exactly the same effect as if you specified direction = + 'next_on_output' -> call cmd_workspace($direction) and so forth.
+
+
+ + + +
+
Note
+
Also note that the order of literals is important here: If next were + ordered before next_on_output, then next_on_output would never + match.
+
+
+
+workspace back_and_forth +
+
+

+ This is a very simple case: When the literal back_and_forth is found + in the input, the function cmd_workspace_back_and_forth will be + called without parameters and the parser will return to the INITIAL + state (since no other state was specified). +

+
+
+workspace <name> +
+
+

+ In this case, the workspace command is followed by an arbitrary string, + possibly in quotes, for example "workspace 3" or "workspace bleh".
+ This is the first time that the token is actually not a literal (not in + single quotes), but just called string. Other possible tokens are word + (the same as string, but stops matching at a whitespace) and end + (matches the end of the input). +

+
+
+workspace number <number> +
+
+

+ The workspace command has to be followed by the keyword number. It + then transitions into the state WORKSPACE_NUMBER, where the actual + parameter will be read. +

+
+
+
+
+

18.2. Introducing a new command

+

The following steps have to be taken in order to properly introduce a new +command (or possibly extend an existing command):

+
    +
  1. +

    +Define a function beginning with cmd_ in the file src/commands.c. Copy + the prototype of an existing function. +

    +
  2. +
  3. +

    +After adding a comment on what the function does, copy the comment and + function definition to include/commands.h. Make the comment in the header + file use double asterisks to make doxygen pick it up. +

    +
  4. +
  5. +

    +Write a test case (or extend an existing test case) for your feature, see + i3 testsuite. For now, it is sufficient to simply call + your command in all the various possible ways. +

    +
  6. +
  7. +

    +Extend the parser specification in parser-specs/commands.spec. Run the + testsuite and see if your new function gets called with the appropriate + arguments for the appropriate input. +

    +
  8. +
  9. +

    +Actually implement the feature. +

    +
  10. +
  11. +

    +Document the feature in the User’s Guide. +

    +
  12. +
+
+
+
+
+

19. Moving containers

+
+

The movement code is pretty delicate. You need to consider all cases before +making any changes or before being able to fully understand how it works.

+
+

19.1. Case 1: Moving inside the same container

+

The reference layout for this case is a single workspace in horizontal +orientation with two containers on it. Focus is on the left container (1).

+
+ +++ + + + + + +

1

2

+
+

When moving the left window to the right (command move right), tree_move will +look for a container with horizontal orientation and finds the parent of the +left container, that is, the workspace. Afterwards, it runs the code branch +commented with "the easy case": it calls TAILQ_NEXT to get the container right +of the current one and swaps both containers.

+
+
+

19.2. Case 2: Move a container into a split container

+

The reference layout for this case is a horizontal workspace with two +containers. The right container is a v-split with two containers. Focus is on +the left container (1).

+
+ +++ + + + + + + + + +

1

2

3

+
+

When moving to the right (command move right), i3 will work like in case 1 +("the easy case"). However, as the right container is not a leaf container, but +a v-split, the left container (1) will be inserted at the right position (below +2, assuming that 2 is focused inside the v-split) by calling insert_con_into.

+

insert_con_into detaches the container from its parent and inserts it +before/after the given target container. Afterwards, the on_remove_child +callback is called on the old parent container which will then be closed, if +empty.

+

Afterwards, con_focus will be called to fix the focus stack and the tree will +be flattened.

+
+
+

19.3. Case 3: Moving to non-existent top/bottom

+

Like in case 1, the reference layout for this case is a single workspace in +horizontal orientation with two containers on it. Focus is on the left +container:

+
+ +++ + + + + + +

1

2

+
+

This time however, the command is move up or move down. tree_move will look +for a container with vertical orientation. As it will not find any, +same_orientation is NULL and therefore i3 will perform a forced orientation +change on the workspace by creating a new h-split container, moving the +workspace contents into it and then changing the workspace orientation to +vertical. Now it will again search for parent containers with vertical +orientation and it will find the workspace.

+

This time, the easy case code path will not be run as we are not moving inside +the same container. Instead, insert_con_into will be called with the focused +container and the container above/below the current one (on the level of +same_orientation).

+

Now, con_focus will be called to fix the focus stack and the tree will be +flattened.

+
+
+

19.4. Case 4: Moving to existent top/bottom

+

The reference layout for this case is a vertical workspace with two containers. +The bottom one is a h-split containing two containers (1 and 2). Focus is on +the bottom left container (1).

+
+ +++ + + + + + + + + +

3

1

2

+
+

This case is very much like case 3, only this time the forced workspace +orientation change does not need to be performed because the workspace already +is in vertical orientation.

+
+
+

19.5. Case 5: Moving in one-child h-split

+

The reference layout for this case is a horizontal workspace with two +containers having a v-split on the left side with a one-child h-split on the +bottom. Focus is on the bottom left container (2(h)):

+
+ +++ + + + + + + + + +

1

3

2(h)

+
+

In this case, same_orientation will be set to the h-split container around +the focused container. However, when trying the easy case, the next/previous +container swap will be NULL. Therefore, i3 will search again for a +same_orientation container, this time starting from the parent of the h-split +container.

+

After determining a new same_orientation container (if it is NULL, the +orientation will be force-changed), this case is equivalent to case 2 or case +4.

+
+
+

19.6. Case 6: Floating containers

+

The reference layout for this case is a horizontal workspace with two +containers plus one floating h-split container. Focus is on the floating +container.

+

TODO: nice illustration. table not possible?

+

When moving up/down, the container needs to leave the floating container and it +needs to be placed on the workspace (at workspace level). This is accomplished +by calling the function attach_to_workspace.

+
+
+
+
+

20. Click handling

+
+

Without much ado, here is the list of cases which need to be considered:

+
    +
  • +

    +click to focus (tiling + floating) and raise (floating) +

    +
  • +
  • +

    +click to focus/raise when in stacked/tabbed mode +

    +
  • +
  • +

    +floating_modifier + left mouse button to drag a floating con +

    +
  • +
  • +

    +floating_modifier + right mouse button to resize a floating con +

    +
  • +
  • +

    +click on decoration in a floating con to either initiate a resize (if there + is more than one child in the floating con) or to drag the + floating con (if it’s the one at the top). +

    +
  • +
  • +

    +click on border in a floating con to resize the floating con +

    +
  • +
  • +

    +floating_modifier + right mouse button to resize a tiling con +

    +
  • +
  • +

    +click on border/decoration to resize a tiling con +

    +
  • +
+
+
+
+

21. Gotchas

+
+
    +
  • +

    +Forgetting to call xcb_flush(conn); after sending a request. This usually + leads to code which looks like it works fine but which does not work under + certain conditions. +

    +
  • +
  • +

    +Forgetting to call floating_fix_coordinates(con, old_rect, new_rect) after + moving workspaces across outputs. Coordinates for floating containers are + not relative to workspace boundaries, so you must correct their coordinates + or those containers will show up in the wrong workspace or not at all. +

    +
  • +
+
+
+
+

22. Thought experiments

+
+

In this section, we collect thought experiments, so that we don’t forget our +thoughts about specific topics. They are not necessary to get into hacking i3, +but if you are interested in one of the topics they cover, you should read them +before asking us why things are the way they are or why we don’t implement +things.

+
+

22.1. Using cgroups per workspace

+

cgroups (control groups) are a linux-only feature which provides the ability to +group multiple processes. For each group, you can individually set resource +limits, like allowed memory usage. Furthermore, and more importantly for our +purposes, they serve as a namespace, a label which you can attach to processes +and their children.

+

One interesting use for cgroups is having one cgroup per workspace (or +container, doesn’t really matter). That way, you could set different priorities +and have a workspace for important stuff (say, writing a LaTeX document or +programming) and a workspace for unimportant background stuff (say, +JDownloader). Both tasks can obviously consume a lot of I/O resources, but in +this example it doesn’t really matter if JDownloader unpacks the download a +minute earlier or not. However, your compiler should work as fast as possible. +Having one cgroup per workspace, you would assign more resources to the +programming workspace.

+

Another interesting feature is that an inherent problem of the workspace +concept could be solved by using cgroups: When starting an application on +workspace 1, then switching to workspace 2, you will get the application’s +window(s) on workspace 2 instead of the one you started it on. This is because +the window manager does not have any mapping between the process it starts (or +gets started in any way) and the window(s) which appear.

+

Imagine for example using dmenu: The user starts dmenu by pressing Mod+d, dmenu +gets started with PID 3390. The user then decides to launch Firefox, which +takes a long time. So they enter firefox into dmenu and press enter. Firefox +gets started with PID 4001. When it finally finishes loading, it creates an X11 +window and uses MapWindow to make it visible. This is the first time i3 +actually gets in touch with Firefox. It decides to map the window, but it has +no way of knowing that this window (even though it has the _NET_WM_PID property +set to 4001) belongs to the dmenu the user started before.

+

How do cgroups help with this? Well, when pressing Mod+d to launch dmenu, i3 +would create a new cgroup, let’s call it i3-3390-1. It launches dmenu in that +cgroup, which gets PID 3390. As before, the user enters firefox and Firefox +gets launched with PID 4001. This time, though, the Firefox process with PID +4001 is also member of the cgroup i3-3390-1 (because fork()ing in a cgroup +retains the cgroup property). Therefore, when mapping the window, i3 can look +up in which cgroup the process is and can establish a mapping between the +workspace and the window.

+

There are multiple problems with this approach:

+
    +
  1. +

    +Every application has to properly set _NET_WM_PID. This is acceptable and + patches can be written for the few applications which don’t set the hint yet. +

    +
  2. +
  3. +

    +It does only work on Linux, since cgroups are a Linux-only feature. Again, + this is acceptable. +

    +
  4. +
  5. +

    +The main problem is that some applications create X11 windows completely + independent of UNIX processes. An example for this is Chromium (or + gnome-terminal), which, when being started a second time, communicates with + the first process and lets the first process open a new window. Therefore, if + you have a Chromium window on workspace 2 and you are currently working on + workspace 3, starting chromium does not lead to the desired result (the + window will open on workspace 2). +

    +
  6. +
+

Therefore, my conclusion is that the only proper way of fixing the "window gets +opened on the wrong workspace" problem is in the application itself. Most +modern applications support freedesktop startup-notifications which can be +used for this.

+
+
+
+
+

+ + + diff --git a/docs/i3bar-protocol.html b/docs/i3bar-protocol.html new file mode 100644 index 0000000..49173b7 --- /dev/null +++ b/docs/i3bar-protocol.html @@ -0,0 +1,1216 @@ + + + + + + +i3bar input protocol + + + + + +
+
+
+

This document explains the protocol in which i3bar expects its input. It +provides support for colors, urgency, shortening and easy manipulation.

+
+
+
+

1. Rationale for choosing JSON

+
+

Before describing the protocol, let’s cover why JSON is a building block of +this protocol.

+
    +
  1. +

    +Other bar display programs such as dzen2 or xmobar are using in-band + signaling: they recognize certain sequences (like ^fg(#330000) in your input + text). We would like to avoid that and separate information from + meta-information. By information, we mean the actual output, like the IP + address of your ethernet adapter and by meta-information, we mean in which + color it should be displayed right now. +

    +
  2. +
  3. +

    +It is easy to write a simple script which manipulates part(s) of the input. + Each block of information (like a block for the disk space indicator, a block + for the current IP address, etc.) can be identified specifically and modified + in whichever way you like. +

    +
  4. +
  5. +

    +It remains easy to write a simple script which just suffixes (or prefixes) a + status line input, because tools like i3status will output their JSON in + such a way that each line array will be terminated by a newline. Therefore, + you are not required to use a streaming JSON parser, but you can use any + JSON parser and write your script in any programming language. In fact, you + can decide to not bother with the JSON parsing at all and just inject your + output at a specific position (beginning or end). +

    +
  6. +
  7. +

    +Relying on JSON does not introduce any new dependencies. In fact, the IPC + interface of i3 also uses JSON, therefore i3bar already depends on JSON. +

    +
  8. +
+

The only point against using JSON is computational complexity. If that really +bothers you, just use the plain text input format (which i3bar will continue to +support).

+
+
+
+

2. The protocol

+
+

The first message of the protocol is a header block, which contains (at least) +the version of the protocol to be used. In case there are significant changes +(not only additions), the version will be incremented. i3bar will still +understand the old protocol version, but in order to use the new one, you need +to provide the correct version. The header block is terminated by a newline and +consists of a single JSON hash:

+

Minimal example:

+
+
+
{ "version": 1 }
+
+

All features example:

+
+
+
{ "version": 1, "stop_signal": 10, "cont_signal": 12, "click_events": true }
+
+

(Note that before i3 v4.3 the precise format had to be {"version":1}, +byte-for-byte.)

+

What follows is an infinite array (so it should be parsed by a streaming JSON +parser, but as described above you can go for a simpler solution), whose +elements are one array per status line. A status line is one unit of +information which should be displayed at a time. i3bar will not display any +input until the status line is complete. In each status line, every block will +be represented by a JSON hash:

+

Example:

+
+
+
[
+
+ [
+  {
+   "full_text": "E: 10.0.0.1 (1000 Mbit/s)",
+   "color": "#00ff00"
+  },
+  {
+   "full_text": "2012-01-05 20:00:01"
+  }
+ ],
+
+ [
+  {
+   "full_text": "E: 10.0.0.1 (1000 Mbit/s)",
+   "color": "#00ff00"
+  },
+  {
+   "full_text": "2012-01-05 20:00:02"
+  }
+ ],
+ …
+
+

Please note that this example was pretty printed for human consumption. +i3status and others will output single statuslines in one line, separated by +\n.

+

You can find an example of a shell script which can be used as your +status_command in the bar configuration at +https://github.com/i3/i3/blob/next/contrib/trivial-bar-script.sh

+
+

2.1. Header in detail

+
+
+version +
+
+

+ The version number (as an integer) of the i3bar protocol you will use. +

+
+
+stop_signal +
+
+

+ Specify to i3bar the signal (as an integer) to send to stop your + processing. + The default value (if none is specified) is SIGSTOP. +

+
+
+cont_signal +
+
+

+ Specify to i3bar the signal (as an integer) to send to continue your + processing. + The default value (if none is specified) is SIGCONT. +

+
+
+click_events +
+
+

+ If specified and true i3bar will write an infinite array (same as above) + to your stdin. +

+
+
+
+
+

2.2. Blocks in detail

+
+
+full_text +
+
+

+ The full_text will be displayed by i3bar on the status line. This is the + only required key. If full_text is an empty string, the block will be + skipped. +

+
+
+short_text +
+
+

+ Where appropriate, the short_text (string) entry should also be + provided. It will be used in case the status line needs to be shortened + because it uses more space than your screen provides. For example, when + displaying an IPv6 address, the prefix is usually (!) more relevant + than the suffix, because the latter stays constant when using autoconf, + while the prefix changes. When displaying the date, the time is more + important than the date (it is more likely that you know which day it + is than what time it is). +

+
+
+color +
+
+

+ To make the current state of the information easy to spot, colors can + be used. For example, the wireless block could be displayed in red + (using the color (string) entry) if the card is not associated with + any network and in green or yellow (depending on the signal strength) + when it is associated. + Colors are specified in hex (like in HTML), starting with a leading + hash sign. For example, #ff0000 means red. +

+
+
+background +
+
+

+ Overrides the background color for this particular block. +

+
+
+border +
+
+

+ Overrides the border color for this particular block. +

+
+
+border_top +
+
+

+ Defines the width (in pixels) of the top border of this block. Defaults + to 1. +

+
+
+border_right +
+
+

+ Defines the width (in pixels) of the right border of this block. Defaults + to 1. +

+
+
+border_bottom +
+
+

+ Defines the width (in pixels) of the bottom border of this block. Defaults + to 1. +

+
+
+border_left +
+
+

+ Defines the width (in pixels) of the left border of this block. Defaults + to 1. +

+
+
+min_width +
+
+

+ The minimum width (in pixels) of the block. If the content of the + full_text key take less space than the specified min_width, the block + will be padded to the left and/or the right side, according to the align + key. This is useful when you want to prevent the whole status line to shift + when value take more or less space between each iteration. + The value can also be a string. In this case, the width of the text given + by min_width determines the minimum width of the block. This is useful + when you want to set a sensible minimum width regardless of which font you + are using, and at what particular size. +

+
+
+align +
+
+

+ Align text on the center, right or left (default) of the block, when + the minimum width of the latter, specified by the min_width key, is not + reached. +

+
+
+name and instance +
+
+

+ Every block should have a unique name (string) entry so that it can + be easily identified in scripts which process the output. i3bar + completely ignores the name and instance fields. Make sure to also + specify an instance (string) entry where appropriate. For example, + the user can have multiple disk space blocks for multiple mount points. +

+
+
+urgent +
+
+

+ A boolean which specifies whether the current value is urgent. Examples + are battery charge values below 1 percent or no more available disk + space (for non-root users). The presentation of urgency is up to i3bar. +

+
+
+separator +
+
+

+ A boolean which specifies whether a separator line should be drawn + after this block. The default is true, meaning the separator line will + be drawn. Note that if you disable the separator line, there will still + be a gap after the block, unless you also use separator_block_width. +

+
+
+separator_block_width +
+
+

+ The amount of pixels to leave blank after the block. In the middle of + this gap, a separator line will be drawn unless separator is + disabled. Normally, you want to set this to an odd value (the default + is 9 pixels), since the separator line is drawn in the middle. +

+
+
+markup +
+
+

+ A string that indicates how the text of the block should be parsed. Set to + "pango" to use Pango markup. + Set to "none" to not use any markup (default). Pango markup only works + if you use a pango font. +

+
+
+

If you want to put in your own entries into a block, prefix the key with an +underscore (_). i3bar will ignore all keys it doesn’t understand, and prefixing +them with an underscore makes it clear in every script that they are not part +of the i3bar protocol.

+

Example:

+
+
+
{
+ "full_text": "E: 10.0.0.1 (1000 Mbit/s)",
+ "_ethernet_vendor": "Intel"
+}
+
+

In the following example, the longest (widest) possible value of the block is +used to set the minimum width:

+
+
+
{
+ "full_text": "CPU 4%",
+ "min_width": "CPU 100%",
+ "align": "left"
+}
+
+

An example of a block which uses all possible entries follows:

+

Example:

+
+
+
{
+ "full_text": "E: 10.0.0.1 (1000 Mbit/s)",
+ "short_text": "10.0.0.1",
+ "color": "#00ff00",
+ "background": "#1c1c1c",
+ "border": "#ee0000",
+ "border_top": 1,
+ "border_right": 0,
+ "border_bottom": 3,
+ "border_left": 1,
+ "min_width": 300,
+ "align": "right",
+ "urgent": false,
+ "name": "ethernet",
+ "instance": "eth0",
+ "separator": true,
+ "separator_block_width": 9,
+ "markup": "none"
+}
+
+
+
+

2.3. Click events

+

If enabled i3bar will send you notifications if the user clicks on a block and +looks like this:

+
+
+name +
+
+

+ Name of the block, if set +

+
+
+instance +
+
+

+ Instance of the block, if set +

+
+
+x, y +
+
+

+ X11 root window coordinates where the click occurred +

+
+
+button +
+
+

+ X11 button ID (for example 1 to 3 for left/middle/right mouse button) +

+
+
+relative_x, relative_y +
+
+

+ Coordinates where the click occurred, with respect to the top left corner + of the block +

+
+
+width, height +
+
+

+ Width and height (in px) of the block +

+
+
+modifiers +
+
+

+ An array of the modifiers active when the click occurred. The order in which + modifiers are listed is not guaranteed. +

+
+
+

Example:

+
+
+
{
+ "name": "ethernet",
+ "instance": "eth0",
+ "button": 1,
+ "modifiers": ["Shift", "Mod1"],
+ "x": 1320,
+ "y": 1400,
+ "relative_x": 12,
+ "relative_y": 8,
+ "width": 50,
+ "height": 22
+}
+
+
+
+
+
+

+ + + diff --git a/docs/ipc.html b/docs/ipc.html new file mode 100644 index 0000000..ca9c453 --- /dev/null +++ b/docs/ipc.html @@ -0,0 +1,2642 @@ + + + + + + +IPC interface (interprocess communication) + + + + + +
+
+
+

This document describes how to interface with i3 from a separate process. This +is useful for example to remote-control i3 (to write test cases for example) or +to get various information like the current workspaces to implement an external +workspace bar.

+

The method of choice for IPC in our case is a unix socket because it has very +little overhead on both sides and is usually available without headaches in +most languages. In the default configuration file, the ipc-socket gets created +in /tmp/i3-%u.XXXXXX/ipc-socket.%p where %u is your UNIX username, %p is +the PID of i3 and XXXXXX is a string of random characters from the portable +filename character set (see mkdtemp(3)). You can get the socketpath from i3 by +calling i3 --get-socketpath.

+

All i3 utilities, like i3-msg and i3-input will read the I3_SOCKET_PATH +X11 property, stored on the X11 root window.

+
+ + + +
+
Warning
+
+
Use an existing library!
There are existing libraries for many languages. You can have a look at +[libraries] or search the web if your language of choice is not mentioned. +Usually, it is not necessary to implement low-level communication with i3 +directly.
+
+
+
+
+

1. Establishing a connection

+
+

To establish a connection, simply open the IPC socket. The following code +snippet illustrates this in Perl:

+
+
+
use IO::Socket::UNIX;
+chomp(my $path = qx(i3 --get-socketpath));
+my $sock = IO::Socket::UNIX->new(Peer => $path);
+
+
+
+
+

2. Sending messages to i3

+
+

To send a message to i3, you have to format in the binary message format which +i3 expects. This format specifies a magic string in the beginning to ensure +the integrity of messages (to prevent follow-up errors). Following the magic +string comes the length of the payload of the message as 32-bit integer, and +the type of the message as 32-bit integer (the integers are not converted, so +they are in native byte order).

+

The magic string currently is "i3-ipc" and will only be changed when a change +in the IPC API is done which breaks compatibility (we hope that we don’t need +to do that).

+
+ + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1. Currently implemented message types
Type (numeric) Type (name) Reply type Purpose

0

RUN_COMMAND

COMMAND

Run the payload as an i3 command (like the commands you can bind to keys).

1

GET_WORKSPACES

WORKSPACES

Get the list of current workspaces.

2

SUBSCRIBE

SUBSCRIBE

Subscribe this IPC connection to the event types specified in the message payload. See [events].

3

GET_OUTPUTS

OUTPUTS

Get the list of current outputs.

4

GET_TREE

TREE

Get the i3 layout tree.

5

GET_MARKS

MARKS

Gets the names of all currently set marks.

6

GET_BAR_CONFIG

BAR_CONFIG

Gets the specified bar configuration or the names of all bar configurations if payload is empty.

7

GET_VERSION

VERSION

Gets the i3 version.

8

GET_BINDING_MODES

BINDING_MODES

Gets the names of all currently configured binding modes.

9

GET_CONFIG

CONFIG

Returns the last loaded i3 config.

10

SEND_TICK

TICK

Sends a tick event with the specified payload.

11

SYNC

SYNC

Sends an i3 sync event with the specified random value to the specified window.

+
+

So, a typical message could look like this:

+
+
+
"i3-ipc" <message length> <message type> <payload>
+
+

Or, as a hexdump:

+
+
+
00000000  69 33 2d 69 70 63 04 00  00 00 00 00 00 00 65 78  |i3-ipc........ex|
+00000010  69 74                                             |it|
+
+

To generate and send such a message, you could use the following code in Perl:

+
+
+
sub format_ipc_command {
+    my ($msg) = @_;
+    my $len;
+    # Get the real byte count (vs. amount of characters)
+    { use bytes; $len = length($msg); }
+    return "i3-ipc" . pack("LL", $len, 0) . $msg;
+}
+
+$sock->write(format_ipc_command("exit"));
+
+
+
+
+

3. Receiving replies from i3

+
+

Replies from i3 usually consist of a simple string (the length of the string +is the message_length, so you can consider them length-prefixed) which in turn +contain the JSON serialization of a data structure. For example, the +GET_WORKSPACES message returns an array of workspaces (each workspace is a map +with certain attributes).

+
+

3.1. Reply format

+

The reply format is identical to the normal message format. There also is +the magic string, then the message length, then the message type and the +payload.

+

The following reply types are implemented:

+
+
+COMMAND (0) +
+
+

+ Confirmation/Error code for the RUN_COMMAND message. +

+
+
+WORKSPACES (1) +
+
+

+ Reply to the GET_WORKSPACES message. +

+
+
+SUBSCRIBE (2) +
+
+

+ Confirmation/Error code for the SUBSCRIBE message. +

+
+
+OUTPUTS (3) +
+
+

+ Reply to the GET_OUTPUTS message. +

+
+
+TREE (4) +
+
+

+ Reply to the GET_TREE message. +

+
+
+MARKS (5) +
+
+

+ Reply to the GET_MARKS message. +

+
+
+BAR_CONFIG (6) +
+
+

+ Reply to the GET_BAR_CONFIG message. +

+
+
+VERSION (7) +
+
+

+ Reply to the GET_VERSION message. +

+
+
+BINDING_MODES (8) +
+
+

+ Reply to the GET_BINDING_MODES message. +

+
+
+GET_CONFIG (9) +
+
+

+ Reply to the GET_CONFIG message. +

+
+
+TICK (10) +
+
+

+ Reply to the SEND_TICK message. +

+
+
+
+
+

3.2. COMMAND reply

+

The reply consists of a list of serialized maps for each command that was +parsed. Each has the property success (bool) and may also include a +human-readable error message in the property error (string).

+
+ + + +
+
Note
+
When sending the restart command, you will get a singular reply once the +restart completed. All IPC connection states (e.g. subscriptions) will reset and +all but one socket will be closed. Libraries must be able to cope with this by +aligning their internal states. It is also recommended that libraries close +the last remaining socket(one which replied to restart command) to achieve +the full reset.
+
+
+ + + +
+
Note
+
It is easiest to always send the restart command alone: due to i3’s +state reset, the reply messages of preceding commands are lost, and following +commands will not be executed.
+
+
+ + + +
+
Note
+
When processing the exit command, i3 will immediately exit without +sending a reply. Expect the socket to be shut down.
+
+

Example:

+
+
+
[{ "success": true }]
+
+
+
+

3.3. WORKSPACES reply

+

The reply consists of a serialized list of workspaces. Each workspace has the +following properties:

+
+
+num (integer) +
+
+

+ The logical number of the workspace. Corresponds to the command + to switch to this workspace. For named workspaces, this will be -1. +

+
+
+name (string) +
+
+

+ The name of this workspace (by default num+1), as changed by the + user. Encoded in UTF-8. +

+
+
+visible (boolean) +
+
+

+ Whether this workspace is currently visible on an output (multiple + workspaces can be visible at the same time). +

+
+
+focused (boolean) +
+
+

+ Whether this workspace currently has the focus (only one workspace + can have the focus at the same time). +

+
+
+urgent (boolean) +
+
+

+ Whether a window on this workspace has the "urgent" flag set. +

+
+
+rect (map) +
+
+

+ The rectangle of this workspace (equals the rect of the output it + is on), consists of x, y, width, height. +

+
+
+output (string) +
+
+

+ The video output this workspace is on (LVDS1, VGA1, …). +

+
+
+

Example:

+
+
+
[
+ {
+  "num": 0,
+  "name": "1",
+  "visible": true,
+  "focused": true,
+  "urgent": false,
+  "rect": {
+   "x": 0,
+   "y": 0,
+   "width": 1280,
+   "height": 800
+  },
+  "output": "LVDS1"
+ },
+ {
+  "num": 1,
+  "name": "2",
+  "visible": false,
+  "focused": false,
+  "urgent": false,
+  "rect": {
+   "x": 0,
+   "y": 0,
+   "width": 1280,
+   "height": 800
+  },
+  "output": "LVDS1"
+ }
+]
+
+
+
+

3.4. SUBSCRIBE reply

+

The reply consists of a single serialized map. The only property is +success (bool), indicating whether the subscription was successful (the +default) or whether a JSON parse error occurred.

+

Example:

+
+
+
{ "success": true }
+
+
+
+

3.5. OUTPUTS reply

+

The reply consists of a serialized list of outputs. Each output has the +following properties:

+
+
+name (string) +
+
+

+ The name of this output (as seen in xrandr(1)). Encoded in UTF-8. +

+
+
+active (boolean) +
+
+

+ Whether this output is currently active (has a valid mode). +

+
+
+primary (boolean) +
+
+

+ Whether this output is currently the primary output. +

+
+
+current_workspace (string) +
+
+

+ The name of the current workspace that is visible on this output. null if + the output is not active. +

+
+
+rect (map) +
+
+

+ The rectangle of this output (equals the rect of the output it + is on), consists of x, y, width, height. +

+
+
+

Example:

+
+
+
[
+ {
+  "name": "LVDS1",
+  "active": true,
+  "current_workspace": "4",
+  "rect": {
+   "x": 0,
+   "y": 0,
+   "width": 1280,
+   "height": 800
+  }
+ },
+ {
+  "name": "VGA1",
+  "active": true,
+  "current_workspace": "1",
+  "rect": {
+   "x": 1280,
+   "y": 0,
+   "width": 1280,
+   "height": 1024
+  }
+ }
+]
+
+
+
+

3.6. TREE reply

+

The reply consists of a serialized tree. Each node in the tree (representing +one container) has at least the properties listed below. While the nodes might +have more properties, please do not use any properties which are not documented +here. They are not yet finalized and will probably change!

+
+
+id (integer) +
+
+

+ The internal ID (actually a C pointer value) of this container. Do not + make any assumptions about it. You can use it to (re-)identify and + address containers when talking to i3. +

+
+
+name (string) +
+
+

+ The internal name of this container. For all containers which are part + of the tree structure down to the workspace contents, this is set to a + nice human-readable name of the container. + For containers that have an X11 window, the content is the title + (_NET_WM_NAME property) of that window. + For all other containers, the content is not defined (yet). +

+
+
+type (string) +
+
+

+ Type of this container. Can be one of "root", "output", "con", + "floating_con", "workspace" or "dockarea". +

+
+
+border (string) +
+
+

+ Can be either "normal", "none" or "pixel", depending on the + container’s border style. +

+
+
+current_border_width (integer) +
+
+

+ Number of pixels of the border width. +

+
+
+layout (string) +
+
+

+ Can be either "splith", "splitv", "stacked", "tabbed", "dockarea" or + "output". + Other values might be possible in the future, should we add new + layouts. +

+
+
+orientation (string) +
+
+

+ Can be either "none" (for non-split containers), "horizontal" or + "vertical". + THIS FIELD IS OBSOLETE. It is still present, but your code should not + use it. Instead, rely on the layout field. +

+
+
+percent (float) +
+
+

+ The percentage which this container takes in its parent. A value of + null means that the percent property does not make sense for this + container, for example for the root container. +

+
+
+rect (map) +
+
+

+ The absolute display coordinates for this container. Display + coordinates means that when you have two 1600x1200 monitors on a single + X11 Display (the standard way), the coordinates of the first window on + the second monitor are { "x": 1600, "y": 0, "width": 1600, "height": + 1200 }. +

+
+
+window_rect (map) +
+
+

+ The coordinates of the actual client window inside its container. + These coordinates are relative to the container and do not include the + window decoration (which is actually rendered on the parent container). + So, when using the default layout, you will have a 2 pixel border on + each side, making the window_rect { "x": 2, "y": 0, "width": 632, + "height": 366 } (for example). +

+
+
+deco_rect (map) +
+
+

+ The coordinates of the window decoration inside its container. These + coordinates are relative to the container and do not include the actual + client window. +

+
+
+geometry (map) +
+
+

+ The original geometry the window specified when i3 mapped it. Used when + switching a window to floating mode, for example. +

+
+
+window (integer) +
+
+

+ The X11 window ID of the actual client window inside this container. + This field is set to null for split containers or otherwise empty + containers. This ID corresponds to what xwininfo(1) and other + X11-related tools display (usually in hex). +

+
+
+window_properties (map) +
+
+

+ X11 window properties title, instance, class, window_role and transient_for. +

+
+
+urgent (bool) +
+
+

+ Whether this container (window, split container, floating container or + workspace) has the urgency hint set, directly or indirectly. All parent + containers up until the workspace container will be marked urgent if they + have at least one urgent child. +

+
+
+focused (bool) +
+
+

+ Whether this container is currently focused. +

+
+
+focus (array of integer) +
+
+

+ List of child node IDs (see nodes, floating_nodes and id) in focus + order. Traversing the tree by following the first entry in this array + will result in eventually reaching the one node with focused set to + true. +

+
+
+nodes (array of node) +
+
+

+ The tiling (i.e. non-floating) child containers of this node. +

+
+
+floating_nodes (array of node) +
+
+

+ The floating child containers of this node. Only non-empty on nodes with + type workspace. +

+
+
+

Please note that in the following example, I have left out some keys/values +which are not relevant for the type of the node. Otherwise, the example would +be by far too long (it already is quite long, despite showing only 1 window and +one dock window).

+

It is useful to have an overview of the structure before taking a look at the +JSON dump:

+
    +
  • +

    +root +

    +
      +
    • +

      +LVDS1 +

      +
        +
      • +

        +topdock +

        +
      • +
      • +

        +content +

        +
          +
        • +

          +workspace 1 +

          +
            +
          • +

            +window 1 +

            +
          • +
          +
        • +
        +
      • +
      • +

        +bottomdock +

        +
          +
        • +

          +dock window 1 +

          +
        • +
        +
      • +
      +
    • +
    • +

      +VGA1 +

      +
    • +
    +
  • +
+

Example:

+
+
+
{
+ "id": 6875648,
+ "name": "root",
+ "rect": {
+   "x": 0,
+   "y": 0,
+   "width": 1280,
+   "height": 800
+ },
+ "nodes": [
+
+   {
+    "id": 6878320,
+    "name": "LVDS1",
+    "layout": "output",
+    "rect": {
+      "x": 0,
+      "y": 0,
+      "width": 1280,
+      "height": 800
+    },
+    "nodes": [
+
+      {
+       "id": 6878784,
+       "name": "topdock",
+       "layout": "dockarea",
+       "orientation": "vertical",
+       "rect": {
+         "x": 0,
+         "y": 0,
+         "width": 1280,
+         "height": 0
+       }
+      },
+
+      {
+       "id": 6879344,
+       "name": "content",
+       "rect": {
+         "x": 0,
+         "y": 0,
+         "width": 1280,
+         "height": 782
+       },
+       "nodes": [
+
+         {
+          "id": 6880464,
+          "name": "1",
+          "orientation": "horizontal",
+          "rect": {
+            "x": 0,
+            "y": 0,
+            "width": 1280,
+            "height": 782
+          },
+          "window_properties": {
+            "class": "Evince",
+            "instance": "evince",
+            "title": "Properties",
+            "transient_for": 52428808
+          },
+          "floating_nodes": [],
+          "nodes": [
+
+            {
+             "id": 6929968,
+             "name": "#aa0000",
+             "border": "normal",
+             "percent": 1,
+             "rect": {
+               "x": 0,
+               "y": 18,
+               "width": 1280,
+               "height": 782
+             }
+            }
+
+          ]
+         }
+
+       ]
+      },
+
+      {
+       "id": 6880208,
+       "name": "bottomdock",
+       "layout": "dockarea",
+       "orientation": "vertical",
+       "rect": {
+         "x": 0,
+         "y": 782,
+         "width": 1280,
+         "height": 18
+       },
+       "nodes": [
+
+         {
+          "id": 6931312,
+          "name": "#00aa00",
+          "percent": 1,
+          "rect": {
+            "x": 0,
+            "y": 782,
+            "width": 1280,
+            "height": 18
+          }
+         }
+
+       ]
+      }
+    ]
+   }
+ ]
+}
+
+
+
+

3.7. MARKS reply

+

The reply consists of a single array of strings for each container that has a +mark. A mark can only be set on one container, so the array is unique. +The order of that array is undefined.

+

If no window has a mark the response will be the empty array [].

+
+
+

3.8. BAR_CONFIG reply

+

This can be used by third-party workspace bars (especially i3bar, but others +are free to implement compatible alternatives) to get the bar block +configuration from i3.

+

Depending on the input, the reply is either:

+
+
+empty input +
+
+

+ An array of configured bar IDs +

+
+
+Bar ID +
+
+

+ A JSON map containing the configuration for the specified bar. +

+
+
+

Each bar configuration has the following properties:

+
+
+id (string) +
+
+

+ The ID for this bar. Included in case you request multiple + configurations and want to differentiate the different replies. +

+
+
+mode (string) +
+
+

+ Either dock (the bar sets the dock window type) or hide (the bar + does not show unless a specific key is pressed). +

+
+
+position (string) +
+
+

+ Either bottom or top at the moment. +

+
+
+status_command (string) +
+
+

+ Command which will be run to generate a statusline. Each line on stdout + of this command will be displayed in the bar. At the moment, no + formatting is supported. +

+
+
+font (string) +
+
+

+ The font to use for text on the bar. +

+
+
+workspace_buttons (boolean) +
+
+

+ Display workspace buttons or not? Defaults to true. +

+
+
+binding_mode_indicator (boolean) +
+
+

+ Display the mode indicator or not? Defaults to true. +

+
+
+verbose (boolean) +
+
+

+ Should the bar enable verbose output for debugging? Defaults to false. +

+
+
+colors (map) +
+
+

+ Contains key/value pairs of colors. Each value is a color code in hex, + formatted #rrggbb (like in HTML). +

+
+
+

The following colors can be configured at the moment:

+
+
+background +
+
+

+ Background color of the bar. +

+
+
+statusline +
+
+

+ Text color to be used for the statusline. +

+
+
+separator +
+
+

+ Text color to be used for the separator. +

+
+
+focused_background +
+
+

+ Background color of the bar on the currently focused monitor output. +

+
+
+focused_statusline +
+
+

+ Text color to be used for the statusline on the currently focused + monitor output. +

+
+
+focused_separator +
+
+

+ Text color to be used for the separator on the currently focused + monitor output. +

+
+
+focused_workspace_text/focused_workspace_bg/focused_workspace_border +
+
+

+ Text/background/border color for a workspace button when the workspace + has focus. +

+
+
+active_workspace_text/active_workspace_bg/active_workspace_border +
+
+

+ Text/background/border color for a workspace button when the workspace + is active (visible) on some output, but the focus is on another one. + You can only tell this apart from the focused workspace when you are + using multiple monitors. +

+
+
+inactive_workspace_text/inactive_workspace_bg/inactive_workspace_border +
+
+

+ Text/background/border color for a workspace button when the workspace + does not have focus and is not active (visible) on any output. This + will be the case for most workspaces. +

+
+
+urgent_workspace_text/urgent_workspace_bg/urgent_workspace_border +
+
+

+ Text/background/border color for workspaces which contain at least one + window with the urgency hint set. +

+
+
+binding_mode_text/binding_mode_bg/binding_mode_border +
+
+

+ Text/background/border color for the binding mode indicator. +

+
+
+

Example of configured bars:

+
+
+
["bar-bxuqzf"]
+
+

Example of bar configuration:

+
+
+
{
+ "id": "bar-bxuqzf",
+ "mode": "dock",
+ "position": "bottom",
+ "status_command": "i3status",
+ "font": "-misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1",
+ "workspace_buttons": true,
+ "binding_mode_indicator": true,
+ "verbose": false,
+ "colors": {
+   "background": "#c0c0c0",
+   "statusline": "#00ff00",
+   "focused_workspace_text": "#ffffff",
+   "focused_workspace_bg": "#000000"
+ }
+}
+
+
+
+

3.9. VERSION reply

+

The reply consists of a single JSON dictionary with the following keys:

+
+
+major (integer) +
+
+

+ The major version of i3, such as 4. +

+
+
+minor (integer) +
+
+

+ The minor version of i3, such as 2. Changes in the IPC interface (new + features) will only occur with new minor (or major) releases. However, + bugfixes might be introduced in patch releases, too. +

+
+
+patch (integer) +
+
+

+ The patch version of i3, such as 1 (when the complete version is + 4.2.1). For versions such as 4.2, patch will be set to 0. +

+
+
+human_readable (string) +
+
+

+ A human-readable version of i3 containing the precise git version, + build date and branch name. When you need to display the i3 version to + your users, use the human-readable version whenever possible (since + this is what i3 --version displays, too). +

+
+
+loaded_config_file_name (string) +
+
+

+ The current config path. +

+
+
+

Example:

+
+
+
{
+   "human_readable" : "4.2-169-gf80b877 (2012-08-05, branch \"next\")",
+   "loaded_config_file_name" : "/home/hwangcc23/.i3/config",
+   "minor" : 2,
+   "patch" : 0,
+   "major" : 4
+}
+
+
+
+

3.10. BINDING_MODES reply

+

The reply consists of an array of all currently configured binding modes.

+

Example:

+
+
+
["default", "resize"]
+
+
+
+

3.11. CONFIG reply

+

The config reply is a map which currently only contains the "config" member, +which is a string containing the config file as loaded by i3 most recently.

+

Example:

+
+
+
{ "config": "font pango:monospace 8\nbindsym Mod4+q exit\n" }
+
+
+
+

3.12. TICK reply

+

The reply is a map containing the "success" member. After the reply was +received, the tick event has been written to all IPC connections which subscribe +to tick events. UNIX sockets are usually buffered, but you can be certain that +once you receive the tick event you just triggered, you must have received all +events generated prior to the SEND_TICK message (happened-before relation).

+

Example:

+
+
+
{ "success": true }
+
+
+
+

3.13. SYNC reply

+

The reply is a map containing the "success" member. After the reply was +received, the i3 sync message was +responded to.

+

Example:

+
+
+
{ "success": true }
+
+
+
+
+
+

4. Events

+
+

To get informed when certain things happen in i3, clients can subscribe to +events. Events consist of a name (like "workspace") and an event reply type +(like I3_IPC_EVENT_WORKSPACE). Events sent by i3 follow a format similar to +replies but with the highest bit of the message type set to 1 to indicate an +event reply instead of a normal reply. Note that event types and reply types +do not follow the same enumeration scheme (e.g. event type 0 corresponds to the +workspace event however reply type 0 corresponds to the COMMAND reply).

+

Caveat: As soon as you subscribe to an event, it is not guaranteed any longer +that the requests to i3 are processed in order. This means, the following +situation can happen: You send a GET_WORKSPACES request but you receive a +"workspace" event before receiving the reply to GET_WORKSPACES. If your +program does not want to cope which such kinds of race conditions (an +event based library may not have a problem here), I suggest you create a +separate connection to receive events.

+

If an event message needs to be sent and the socket is not writeable (write +returns EAGAIN, happens when the socket doesn’t have enough buffer space for +writing new data) then i3 uses a queue system to store outgoing messages for +each client. This is combined with a timer: if the message queue for a client is +not empty and no data where successfully written in the past 10 seconds, the +connection is killed. Practically, this means that your client should try to +always read events from the socket to avoid having its connection closed.

+
+

4.1. Subscribing to events

+

By sending a message of type SUBSCRIBE with a JSON-encoded array as payload +you can register to an event.

+

Example:

+
+
+
type: SUBSCRIBE
+payload: [ "workspace", "output" ]
+
+
+
+

4.2. Available events

+

The numbers in parenthesis is the event type (keep in mind that you need to +strip the highest bit first).

+
+
+workspace (0) +
+
+

+ Sent when the user switches to a different workspace, when a new + workspace is initialized or when a workspace is removed (because the + last client vanished). +

+
+
+output (1) +
+
+

+ Sent when RandR issues a change notification (of either screens, + outputs, CRTCs or output properties). +

+
+
+mode (2) +
+
+

+ Sent whenever i3 changes its binding mode. +

+
+
+window (3) +
+
+

+ Sent when a client’s window is successfully reparented (that is when i3 + has finished fitting it into a container), when a window received input + focus or when certain properties of the window have changed. +

+
+
+barconfig_update (4) +
+
+

+ Sent when the hidden_state or mode field in the barconfig of any bar + instance was updated and when the config is reloaded. +

+
+
+binding (5) +
+
+

+ Sent when a configured command binding is triggered with the keyboard or + mouse +

+
+
+shutdown (6) +
+
+

+ Sent when the ipc shuts down because of a restart or exit by user command +

+
+
+tick (7) +
+
+

+ Sent when the ipc client subscribes to the tick event (with "first": + true) or when any ipc client sends a SEND_TICK message (with "first": + false). +

+
+
+

Example:

+
+
+
# the appropriate 4 bytes read from the socket are stored in $input
+
+# unpack a 32-bit unsigned integer
+my $message_type = unpack("L", $input);
+
+# check if the highest bit is 1
+my $is_event = (($message_type >> 31) == 1);
+
+# use the other bits
+my $event_type = ($message_type & 0x7F);
+
+if ($is_event) {
+  say "Received event of type $event_type";
+}
+
+
+
+

4.3. workspace event

+

This event consists of a single serialized map containing a property +change (string) which indicates the type of the change ("focus", "init", +"empty", "urgent", "reload", "rename", "restored", "move"). A +current (object) property will be present with the affected workspace +whenever the type of event affects a workspace (otherwise, it will be null).

+

When the change is "focus", an old (object) property will be present with the +previous workspace. When the first switch occurs (when i3 focuses the +workspace visible at the beginning) there is no previous workspace, and the +old property will be set to null. Also note that if the previous is empty +it will get destroyed when switching, but will still be present in the "old" +property.

+

Example:

+
+
+
{
+ "change": "focus",
+ "current": {
+  "id": 28489712,
+  "type": "workspace",
+  ...
+ }
+ "old": {
+  "id": 28489715,
+  "type": "workspace",
+  ...
+ }
+}
+
+
+
+

4.4. output event

+

This event consists of a single serialized map containing a property +change (string) which indicates the type of the change (currently only +"unspecified").

+

Example:

+
+
+
{ "change": "unspecified" }
+
+
+
+

4.5. mode event

+

This event consists of a single serialized map containing a property +change (string) which holds the name of current mode in use. The name +is the same as specified in config when creating a mode. The default +mode is simply named default. It contains a second property, pango_markup, which +defines whether pango markup shall be used for displaying this mode.

+

Example:

+
+
+
{
+  "change": "default",
+  "pango_markup": true
+}
+
+
+
+

4.6. window event

+

This event consists of a single serialized map containing a property +change (string) which indicates the type of the change

+
    +
  • +

    +new – the window has become managed by i3 +

    +
  • +
  • +

    +close – the window has closed +

    +
  • +
  • +

    +focus – the window has received input focus +

    +
  • +
  • +

    +title – the window’s title has changed +

    +
  • +
  • +

    +fullscreen_mode – the window has entered or exited fullscreen mode +

    +
  • +
  • +

    +move – the window has changed its position in the tree +

    +
  • +
  • +

    +floating – the window has transitioned to or from floating +

    +
  • +
  • +

    +urgent – the window has become urgent or lost its urgent status +

    +
  • +
  • +

    +mark – a mark has been added to or removed from the window +

    +
  • +
+

Additionally a container (object) field will be present, which consists +of the window’s parent container. Be aware that for the "new" event, the +container will hold the initial name of the newly reparented window (e.g. +if you run urxvt with a shell that changes the title, you will still at +this point get the window title as "urxvt").

+

Example:

+
+
+
{
+ "change": "new",
+ "container": {
+  "id": 35569536,
+  "type": "con",
+  ...
+ }
+}
+
+
+
+

4.7. barconfig_update event

+

This event consists of a single serialized map reporting on options from the +barconfig of the specified bar_id that were updated in i3. This event is the +same as a GET_BAR_CONFIG reply for the bar with the given id.

+
+
+

4.8. binding event

+

This event consists of a single serialized map reporting on the details of a +binding that ran a command because of user input. The change (string) field +indicates what sort of binding event was triggered (right now it will always be +"run" but may be expanded in the future).

+

The binding (object) field contains details about the binding that was run:

+
+
+command (string) +
+
+

+ The i3 command that is configured to run for this binding. +

+
+
+event_state_mask (array of strings) +
+
+

+ The group and modifier keys that were configured with this binding. +

+
+
+input_code (integer) +
+
+

+ If the binding was configured with bindcode, this will be the key code + that was given for the binding. If the binding is a mouse binding, it will be + the number of the mouse button that was pressed. Otherwise it will be 0. +

+
+
+symbol (string or null) +
+
+

+ If this is a keyboard binding that was configured with bindsym, this + field will contain the given symbol. Otherwise it will be null. +

+
+
+input_type (string) +
+
+

+ This will be "keyboard" or "mouse" depending on whether or not this was + a keyboard or a mouse binding. +

+
+
+

Example:

+
+
+
{
+ "change": "run",
+ "binding": {
+  "command": "nop",
+  "event_state_mask": [
+    "shift",
+    "ctrl"
+  ],
+  "input_code": 0,
+  "symbol": "t",
+  "input_type": "keyboard"
+ }
+}
+
+
+
+

4.9. shutdown event

+

This event is triggered when the connection to the ipc is about to shutdown +because of a user action such as a restart or exit command. The change +(string) field indicates why the ipc is shutting down. It can be either +"restart" or "exit".

+

Example:

+
+
+
{
+ "change": "restart"
+}
+
+
+
+

4.10. tick event

+

This event is triggered by a subscription to tick events or by a SEND_TICK +message.

+

Example (upon subscription):

+
+
+
{
+ "first": true,
+ "payload": ""
+}
+
+

Example (upon SEND_TICK with a payload of arbitrary string):

+
+
+
{
+ "first": false,
+ "payload": "arbitrary string"
+}
+
+
+
+
+
+

5. See also (existing libraries)

+
+

For some languages, libraries are available (so you don’t have to implement +all this on your own). This list names some (if you wrote one, please let me +know):

+
+
+C +
+
+
+
+
+C++ +
+
+ +
+
+Go +
+
+ +
+
+JavaScript +
+
+ +
+
+Lua +
+
+ +
+
+Perl +
+
+ +
+
+Python +
+
+ +
+
+Ruby +
+
+ +
+
+Rust +
+
+ +
+
+OCaml +
+
+ +
+
+
+
+
+

6. Appendix A: Detecting byte order in memory-safe languages

+
+

Some programming languages such as Go don’t offer a way to serialize data in the +native byte order of the machine they’re running on without resorting to tricks +involving the unsafe package.

+

The following technique can be used (and will not be broken by changes to i3) to +detect the byte order i3 is using:

+
    +
  1. +

    +The byte order dependent fields of an IPC message are message type and + payload length. +

    +
      +
    • +

      +The message type RUN_COMMAND (0) is the same in big and little endian, so + we can use it in either byte order to elicit a reply from i3. +

      +
    • +
    • +

      +The payload length 65536 + 256 (0x00 01 01 00) is the same in big and + little endian, and also small enough to not worry about memory allocations + of that size. We must use payloads of length 65536 + 256 in every message + we send, so that i3 will be able to read the entire message regardless of + the byte order it uses. +

      +
    • +
    +
  2. +
  3. +

    +Send a big endian encoded message of type SUBSCRIBE (2) with payload [] + followed by 65536 + 256 - 2 SPACE (ASCII 0x20) bytes. +

    +
      +
    • +

      +If i3 is running in big endian, this message is treated as a noop, + resulting in a SUBSCRIBE reply with payload {"success":true} +
      [A small payload is important: that way, we circumvent dealing + with UNIX domain socket buffer sizes, whose size depends on the + implementation/operating system. Exhausting such a buffer results in an i3 + deadlock unless you concurrently read and write, which — depending on the + programming language — makes the technique much more complicated.]
      . +

      +
    • +
    • +

      +If i3 is running in little endian, this message is read in its entirety due + to the byte order independent payload length, then + silently + discarded due to the unknown message type. +

      +
    • +
    +
  4. +
  5. +

    +Send a byte order independent message, i.e. type RUN_COMMAND (0) with + payload nop byte order detection. padding:, padded to 65536 + 256 bytes + with a (ASCII 0x61) bytes. i3 will reply to this message with a reply of + type COMMAND (0). +

    +
      +
    • +

      +The human-readable prefix is in there to not confuse readers of the i3 log. +

      +
    • +
    • +

      +This messages serves as a synchronization primitive so that we know whether + i3 discarded the SUBSCRIBE message or didn’t answer it yet. +

      +
    • +
    +
  6. +
  7. +

    +Receive a message header from i3, decoding the message type as big endian. +

    +
      +
    • +

      +If the message’s reply type is COMMAND (0), i3 is running in little + endian (because the SUBSCRIBE message was discarded). Decode the message + payload length as little endian, receive the message payload. +

      +
    • +
    • +

      +If the message’s reply type is anything else, i3 is running in big endian + (because our big endian encoded SUBSCRIBE message was answered). Decode + the message payload length in big endian, receive the message + payload. Then, receive the pending COMMAND message reply in big endian. +

      +
    • +
    +
  8. +
  9. +

    +From here on out, send/receive all messages using the detected byte order. +

    +
  10. +
+

Find an example implementation of this technique in +https://github.com/i3/go-i3/blob/master/byteorder.go

+
+
+
+

+ + + diff --git a/docs/layout-saving.html b/docs/layout-saving.html new file mode 100644 index 0000000..55350aa --- /dev/null +++ b/docs/layout-saving.html @@ -0,0 +1,1046 @@ + + + + + + +Layout saving in i3 + + + + + +
+
+
+

Layout saving/restoring is a feature that was introduced in i3 v4.8.

+

Layout saving/restoring allows you to load a JSON layout file so that you can +have a base layout to start working with after powering on your computer. +Dynamic use-cases also come to mind: if you frequently (but not always!) need a +grid layout of terminals with ping/traceroute commands to diagnose network +issues, you can easily automate opening these windows in just the right layout.

+
+
+
+

1. Saving the layout

+
+

You can save the layout of either a single workspace or an entire output (e.g. +LVDS1). Of course, you can repeat this step multiple times if you want to +save/restore multiple workspaces/outputs.

+

i3-save-tree(1) is a tool to save the layout. It will print a JSON +representation of i3’s internal layout data structures to stdout. Typically, +you may want to take a quick look at the output, then save it to a file and +tweak it a little bit:

+
+
+
i3-save-tree --workspace 1 > ~/.i3/workspace-1.json
+
+

Please note that the output of i3-save-tree(1) is NOT useful until you +manually modify it — you need to tell i3 how to match/distinguish windows (for +example based on their WM_CLASS, title, etc.). By default, all the different +window properties are included in the output, but commented out. This is partly +to avoid relying on heuristics and partly to make you aware how i3 works so +that you can easily solve layout restoring problems.

+

How to modify the file manually is described in [EditingLayoutFiles].

+
+
+
+

2. Restoring the layout

+
+

After restoring the example layout from [EditingLayoutFiles], i3 will open +placeholder windows for all the windows that were specified in the layout file. +You can recognize the placeholder windows by the watch symbol +
[Depending on the font you are using, a placeholder symbol may show up +instead of the watch symbol.]
in the center of the window, and by the swallow +criteria specification at the top of the window:

+

+ +Restored layout + +

+

When an application opens a window that matches the specified swallow criteria, +it will be placed in the corresponding placeholder window. We say it gets +swallowed by the placeholder container, hence the term.

+

Note: Swallowing windows into unsatisfied placeholder windows takes precedence +over +assignment +rules. For example, if you assign all Emacs windows to workspace 1 in your i3 +configuration file, but there is a placeholder window on workspace 2 which +matches Emacs as well, your newly started Emacs window will end up in the +placeholder window on workspace 2.

+

The placeholder windows are just regular windows, so feel free to move them +around or close them, for example.

+
+

2.1. append_layout command

+

The append_layout command is used to load a layout file into i3. It accepts a +path (relative to i3’s current working directory or absolute) to a JSON file.

+

Syntax:

+
+
+
append_layout <path>
+
+

Examples:

+
+
+
# From a terminal or script:
+i3-msg "workspace 1; append_layout /home/michael/.i3/workspace-1.json"
+
+# In your i3 configuration file, you can autostart i3-msg like this:
+# (Note that those lines will quickly become long, so typically you would store
+#  them in a script with proper indentation.)
+exec --no-startup-id "i3-msg 'workspace 1; append_layout /home/michael/.i3/workspace-1.json'"
+
+
+
+
+
+

3. Editing layout files

+
+
+

3.1. Anatomy of a layout file

+

Here is an example layout file that we’ll discuss:

+
+
+
{
+    // splitv split container with 2 children
+    "layout": "splitv",
+    "percent": 0.4,
+    "type": "con",
+    "nodes": [
+        {
+            "border": "none",
+            "name": "irssi",
+            "percent": 0.5,
+            "type": "con",
+            "swallows": [
+                {
+                    "class": "^URxvt$",
+                    "instance": "^irssi$"
+                }
+            ]
+        },
+        {
+            // stacked split container with 2 children
+            "layout": "stacked",
+            "percent": 0.5,
+            "type": "con",
+            "nodes": [
+                {
+                    "name": "notmuch",
+                    "percent": 0.5,
+                    "type": "con",
+                    "swallows": [
+                        {
+                            "class": "^Emacs$",
+                            "instance": "^notmuch$"
+                        }
+                    ]
+                },
+                {
+                    "name": "midna: ~",
+                    "percent": 0.5,
+                    "type": "con"
+                }
+            ]
+        }
+    ]
+}
+
+{
+    // stacked split container with 1 children
+    "layout": "stacked",
+    "percent": 0.6,
+    "type": "con",
+    "nodes": [
+        {
+            "name": "chrome",
+            "type": "con",
+            "swallows": [
+                {
+                    "class": "^Google-chrome$"
+                }
+            ]
+        }
+    ]
+}
+
+

In this layout, the screen is divided into two columns. In the left column, +which covers 40% of the screen, there is a terminal emulator running irssi on +the top, and a stacked split container with an Emacs window and a terminal +emulator on the bottom. In the right column, there is a stacked container with +a Chrome window:

+

+ +Restored layout + +

+

The structure of this JSON file looks a lot like the TREE reply, see +https://build.i3wm.org/docs/ipc.html#_tree_reply for documentation on that. Some +properties are excluded because they are not relevant when restoring a layout.

+

Most importantly, look at the "swallows" section of each window. This is where +you need to be more or less specific. As an example, remember the section about +the Emacs window:

+
+
+
"swallows": [
+    {
+        "class": "^Emacs$",
+        "instance": "^notmuch$"
+    }
+]
+
+

Here you can see that i3 will require both the class and the instance to match. +Therefore, if you just start Emacs via dmenu, it will not get swallowed by that +container. Only if you start Emacs with the proper instance name (emacs24 +--name notmuch), it will get swallowed.

+

You can match on "class", "instance", "window_role" and "title". All values are +case-sensitive regular expressions (PCRE). Use xprop(1) and click into a +window to see its properties:

+
+
+
$ xprop
+WM_WINDOW_ROLE(STRING) = "gimp-toolbox-color-dialog"
+WM_CLASS(STRING) = "gimp-2.8", "Gimp-2.8"
+_NET_WM_NAME(UTF8_STRING) = "Change Foreground Color"
+
+

The first part of WM_CLASS is the "instance" (gimp-2.8 in this case), the +second part is the "class" (Gimp-2.8 in this case). "title" matches against +_NET_WM_NAME and "window_role" matches against WM_WINDOW_ROLE.

+

In general, you should try to be as specific as possible in your swallow +criteria. Try to use criteria that match one window and only one window, to +have a reliable startup procedure.

+

If you specify multiple swallow criteria, the placeholder will be replaced by +the window which matches any of the criteria. As an example:

+
+
+
// Matches either Emacs or Gvim, whichever one is started first.
+"swallows": [
+    {"class": "^Emacs$"},
+    {"class": "^Gvim$"}
+]
+
+
+
+

3.2. JSON standard non-compliance

+

A layout file as generated by i3-save-tree(1) is not strictly valid JSON:

+
    +
  1. +

    +Layout files contain multiple “JSON texts” at the top level. The JSON + standard doesn’t prohibit this, but in practice most JSON parsers only + allow precisely one “text” per document/file, and will mark multiple texts + as invalid JSON. +

    +
  2. +
  3. +

    +Layout files contain comments which are not allowed by the JSON standard, + but are understood by many parsers. +

    +
  4. +
+

Both of these deviations from the norm are to make manual editing by humans +easier. In case you are writing a more elaborate tool for manipulating these +layouts, you can either use a JSON parser that supports these deviations (for +example libyajl), transform the layout file to a JSON-conforming file, or +submit a patch +to make i3-save-tree(1) optionally output standard-conforming JSON.

+
+
+
+
+

4. Troubleshooting

+
+
+

4.1. Restoring a vertically split workspace

+

When using i3-save-tree with the --workspace switch, only the contents of +the workspace will be dumped. This means that properties of the workspace +itself will be lost.

+

This is relevant for, e.g., a vertically split container as the base container of +a workspace. Since the split mode is a property of the workspace, it will not be +stored. In this case, you will have to manually wrap your layout in such a +container:

+
+
+
// vim:ts=4:sw=4:et
+{
+    // this is a manually added container to restore the vertical split
+    "layout": "splitv",
+    "percent": 0.5,
+    "type": "con",
+    "nodes": [
+
+        // the dumped workspace layout goes here
+
+    ]
+}
+
+
+
+

4.2. Placeholders using window title matches don’t swallow the window

+

If you use the title attribute to match a window and find that it doesn’t +work or only works sometimes, the reason might be that the application sets the +title only after making the window visible. This will be especially true for +programs running inside terminal emulators, e.g., urxvt -e irssi when +matching on title: "irssi".

+

One way to deal with this is to not rely on the title, but instead use, e.g., +the instance attribute and running the program to set this window instance to +that value:

+
+
+
# Run irssi via
+# urxvt -name "irssi-container" -e irssi
+
+"swallows": [
+    {
+        "class": "URxvt",
+        "instance": "irssi-container"
+    }
+]
+
+
+
+
+
+

+ + + diff --git a/docs/lib-i3test-test.html b/docs/lib-i3test-test.html new file mode 100644 index 0000000..8187fd7 --- /dev/null +++ b/docs/lib-i3test-test.html @@ -0,0 +1,145 @@ + + + + + + + + + + +i3test::Test + + + +
+

i3 - improved tiling WM

+ +
+
+

i3 Perl documentation

+ + + + + +

NAME

+ +

i3test::Test - Additional test instructions for use in i3 testcases

+ +

SYNOPSIS

+
  use i3test;
+
+  my $ws = fresh_workspace;
+  is_num_children($ws, 0, 'no containers on this workspace yet');
+  cmd 'open';
+  is_num_children($ws, 1, 'one container after "open"');
+
+  done_testing;
+

DESCRIPTION

+ +

This module provides convenience methods for i3 testcases. If you notice that a certain pattern is present in 5 or more test cases, it should most likely be moved into this module.

+ +

EXPORT

+ +

is_num_children($workspace, $expected, $test_name)

+ +

Gets the number of children on the given workspace and verifies that they match the expected amount of children.

+
  is_num_children('1', 0, 'no containers on workspace 1 at startup');
+

is_num_fullscreen($workspace, $expected, $test_name)

+ +

Gets the number of fullscreen containers on the given workspace and verifies that they match the expected amount.

+
  is_num_fullscreen('1', 0, 'no fullscreen containers on workspace 1');
+

cmp_float($a, $b)

+ +

Compares floating point numbers $a and $b and returns true if they differ less then 1e-6.

+
  $tmp = fresh_workspace;
+
+  open_window for (1..4);
+
+  cmd 'resize grow width 10 px or 25 ppt';
+
+  ($nodes, $focus) = get_ws_content($tmp);
+  ok(cmp_float($nodes->[0]->{percent}, 0.166666666666667), 'first window got 16%');
+  ok(cmp_float($nodes->[1]->{percent}, 0.166666666666667), 'second window got 16%');
+  ok(cmp_float($nodes->[2]->{percent}, 0.166666666666667), 'third window got 16%');
+  ok(cmp_float($nodes->[3]->{percent}, 0.50), 'fourth window got 50%');
+

does_i3_live

+ +

Returns true if the layout tree can still be received from i3.

+
  # i3 used to crash on invalid commands in revision X
+  cmd 'invalid command';
+  does_i3_live;
+

AUTHOR

+ +

Michael Stapelberg <michael@i3wm.org>

+ + + + diff --git a/docs/lib-i3test.html b/docs/lib-i3test.html new file mode 100644 index 0000000..53c8b1b --- /dev/null +++ b/docs/lib-i3test.html @@ -0,0 +1,547 @@ + + + + + + + + + + +i3test + + + +
+

i3 - improved tiling WM

+ +
+
+

i3 Perl documentation

+ + + + + +

NAME

+ +

i3test - Testcase setup module

+ +

SYNOPSIS

+
  use i3test;
+
+  my $ws = fresh_workspace;
+  is_num_children($ws, 0, 'no containers on this workspace yet');
+  cmd 'open';
+  is_num_children($ws, 1, 'one container after "open"');
+
+  done_testing;
+

DESCRIPTION

+ +

This module is used in every i3 testcase and takes care of automatically starting i3 before any test instructions run. It also saves you typing of lots of boilerplate in every test file.

+ +

i3test automatically "use"s Test::More, Data::Dumper, AnyEvent::I3, Time::HiRes’s sleep and i3test::Test so that all of them are available to you in your testcase.

+ +

See also i3test::Test (https://build.i3wm.org/docs/lib-i3test-test.html) which provides additional test instructions (like ok or is).

+ +

EXPORT

+ +

wait_for_event($timeout, $callback)

+ +

Waits for the next event and calls the given callback for every event to determine if this is the event we are waiting for.

+ +

Can be used to wait until a window is mapped, until a ClientMessage is received, etc.

+
  wait_for_event 0.25, sub { $_[0]->{response_type} == MAP_NOTIFY };
+

wait_for_map($window)

+ +

Thin wrapper around wait_for_event which waits for MAP_NOTIFY. Make sure to include 'structure_notify' in the window’s event_mask attribute.

+ +

This function is called by open_window, so in most cases, you don’t need to call it on your own. If you need special setup of the window before mapping, you might have to map it on your own and use this function:

+
  my $window = open_window(dont_map => 1);
+  # Do something special with the window first
+  # …
+
+  # Now map it and wait until it’s been mapped
+  $window->map;
+  wait_for_map($window);
+

wait_for_unmap($window)

+ +

Wrapper around wait_for_event which waits for UNMAP_NOTIFY. Also calls sync_with_i3 to make sure i3 also picked up and processed the UnmapNotify event.

+
  my $ws = fresh_workspace;
+  my $window = open_window;
+  is_num_children($ws, 1, 'one window on workspace');
+  $window->unmap;
+  wait_for_unmap;
+  is_num_children($ws, 0, 'no more windows on this workspace');
+

open_window([ $args ])

+ +

Opens a new window (see X11::XCB::Window), maps it, waits until it got mapped and synchronizes with i3.

+ +

The following arguments can be passed:

+ +
+
class
+ +
+

The X11 window class (e.g. WINDOW_CLASS_INPUT_OUTPUT), not to be confused with the WM_CLASS!

+ +
rect
+ +
+

An arrayref with 4 members specifying the initial geometry (position and size) of the window, e.g. [ 0, 100, 70, 50 ] for a window appearing at x=0, y=100 with width=70 and height=50.

+ +

Note that this is entirely irrelevant for tiling windows.

+ +
background_color
+ +
+

The background pixel color of the window, formatted as "#rrggbb", like HTML color codes (e.g. #c0c0c0). This is useful to tell windows apart when actually watching the testcases.

+ +
event_mask
+ +
+

An arrayref containing strings which describe the X11 event mask we use for that window. The default is [ 'structure_notify' ].

+ +
name
+ +
+

The window’s _NET_WM_NAME (UTF-8 window title). By default, this is "Window n" with n being replaced by a counter to keep windows apart.

+ +
dont_map
+ +
+

Set to a true value to avoid mapping the window (making it visible).

+ +
before_map
+ +
+

A coderef which is called before the window is mapped (unless dont_map is true). The freshly created $window is passed as $_ and as the first argument.

+
+
+ +

The default values are equivalent to this call:

+
  open_window(
+    class => WINDOW_CLASS_INPUT_OUTPUT
+    rect => [ 0, 0, 30, 30 ]
+    background_color => '#c0c0c0'
+    event_mask => [ 'structure_notify' ]
+    name => 'Window <n>'
+  );
+

Usually, though, calls are simpler:

+
  my $top_window = open_window;
+

To identify the resulting window object in i3 commands, use the id property:

+
  my $top_window = open_window;
+  cmd '[id="' . $top_window->id . '"] kill';
+

open_floating_window([ $args ])

+ +

Thin wrapper around open_window which sets window_type to _NET_WM_WINDOW_TYPE_UTILITY to make the window floating.

+ +

The arguments are the same as those of open_window.

+ +

get_workspace_names()

+ +

Returns an arrayref containing the name of every workspace (regardless of its output) which currently exists.

+
  my $workspace_names = get_workspace_names;
+  is(scalar @$workspace_names, 3, 'three workspaces exist currently');
+

get_output_for_workspace()

+ +

Returns the name of the output on which this workspace resides

+
  cmd 'focus output fake-1';
+  cmd 'workspace 1';
+  is(get_output_for_workspace('1', 'fake-0', 'Workspace 1 in output fake-0');
+

get_unused_workspace

+ +

Returns a workspace name which has not yet been used. See also fresh_workspace which directly switches to an unused workspace.

+
  my $ws = get_unused_workspace;
+  cmd "workspace $ws";
+

fresh_workspace([ $args ])

+ +

Switches to an unused workspace and returns the name of that workspace.

+ +

Optionally switches to the specified output first.

+
    my $ws = fresh_workspace;
+
+    # Get a fresh workspace on the second output.
+    my $ws = fresh_workspace(output => 1);
+

get_ws($workspace)

+ +

Returns the container (from the i3 layout tree) which represents $workspace.

+
  my $ws = fresh_workspace;
+  my $ws_con = get_ws($ws);
+  ok(!$ws_con->{urgent}, 'fresh workspace not marked urgent');
+

Here is an example which counts the number of urgent containers recursively, starting from the workspace container:

+
  sub count_urgent {
+      my ($con) = @_;
+
+      my @children = (@{$con->{nodes}}, @{$con->{floating_nodes}});
+      my $urgent = grep { $_->{urgent} } @children;
+      $urgent += count_urgent($_) for @children;
+      return $urgent;
+  }
+  my $urgent = count_urgent(get_ws($ws));
+  is($urgent, 3, "three urgent windows on workspace $ws");
+

get_ws_content($workspace)

+ +

Returns the content (== tree, starting from the node of a workspace) of a workspace. If called in array context, also includes the focus stack of the workspace.

+
  my $nodes = get_ws_content($ws);
+  is(scalar @$nodes, 4, 'there are four containers at workspace-level');
+

Or, in array context:

+
  my $window = open_window;
+  my ($nodes, $focus) = get_ws_content($ws);
+  is($focus->[0], $window->id, 'newly opened window focused');
+

Note that this function does not do recursion for you! It only returns the containers on workspace level. If you want to work with all containers (even nested ones) on a workspace, you have to use recursion:

+
  # NB: This function does not count floating windows
+  sub count_urgent {
+      my ($nodes) = @_;
+
+      my $urgent = 0;
+      for my $con (@$nodes) {
+          $urgent++ if $con->{urgent};
+          $urgent += count_urgent($con->{nodes});
+      }
+
+      return $urgent;
+  }
+  my $nodes = get_ws_content($ws);
+  my $urgent = count_urgent($nodes);
+  is($urgent, 3, "three urgent windows on workspace $ws");
+

If you also want to deal with floating windows, you have to use get_ws instead and access ->{nodes} and ->{floating_nodes} on your own.

+ +

get_focused($workspace)

+ +

Returns the container ID of the currently focused container on $workspace.

+ +

Note that the container ID is not the X11 window ID, so comparing the result of get_focused with a window's ->{id} property does not work.

+
  my $ws = fresh_workspace;
+  my $first_window = open_window;
+  my $first_id = get_focused();
+
+  my $second_window = open_window;
+  my $second_id = get_focused();
+
+  cmd 'focus left';
+
+  is(get_focused($ws), $first_id, 'second window focused');
+

get_dock_clients([ $dockarea ])

+ +

Returns an array of all dock containers in $dockarea (one of "top" or "bottom"). If $dockarea is not specified, returns an array of all dock containers in any dockarea.

+
  my @docked = get_dock_clients;
+  is(scalar @docked, 0, 'no dock clients yet');
+

cmd($command)

+ +

Sends the specified command to i3 and returns the output.

+
  my $ws = unused_workspace;
+  cmd "workspace $ws";
+  cmd 'focus right';
+

workspace_exists($workspace)

+ +

Returns true if $workspace is the name of an existing workspace.

+
  my $old_ws = focused_ws;
+  # switch away from where we currently are
+  fresh_workspace;
+
+  ok(workspace_exists($old_ws), 'old workspace still exists');
+

focused_ws

+ +

Returns the name of the currently focused workspace.

+
  my $ws = focused_ws;
+  is($ws, '1', 'i3 starts on workspace 1');
+

sync_with_i3([ $args ])

+ +

Sends an I3_SYNC ClientMessage with a random value to the root window. i3 will reply with the same value, but, due to the order of events it processes, only after all other events are done.

+ +

This can be used to ensure the results of a cmd 'focus left' are pushed to X11 and that $x->input_focus returns the correct value afterwards.

+ +

See also https://build.i3wm.org/docs/testsuite.html for a longer explanation.

+
  my $window = open_window;
+  $window->add_hint('urgency');
+  # Ensure i3 picked up the change
+  sync_with_i3;
+

The only time when you need to use the no_cache argument is when you just killed your own X11 connection:

+
  cmd 'kill client';
+  # We need to re-establish the X11 connection which we just killed :).
+  $x = i3test::X11->new;
+  sync_with_i3(no_cache => 1);
+

exit_gracefully($pid, [ $socketpath ])

+ +

Tries to exit i3 gracefully (with the 'exit' cmd) or kills the PID if that fails.

+ +

If $socketpath is not specified, get_socket_path() will be called.

+ +

You only need to use this function if you have launched i3 on your own with launch_with_config. Otherwise, it will be automatically called when the testcase ends.

+
  use i3test i3_autostart => 0;
+  my $pid = launch_with_config($config);
+  # …
+  exit_gracefully($pid);
+

exit_forcefully($pid, [ $signal ])

+ +

Tries to exit i3 forcefully by sending a signal (defaults to SIGTERM).

+ +

You only need to use this function if you want to test signal handling (in which case you must have launched i3 on your own with launch_with_config).

+
  use i3test i3_autostart => 0;
+  my $pid = launch_with_config($config);
+  # …
+  exit_forcefully($pid);
+

get_socket_path([ $cache ])

+ +

Gets the socket path from the I3_SOCKET_PATH atom stored on the X11 root window. After the first call, this function will return a cached version of the socket path unless you specify a false value for $cache.

+
  my $i3 = i3(get_socket_path());
+  $i3->command('nop test example')->recv;
+

To avoid caching:

+
  my $i3 = i3(get_socket_path(0));
+

launch_with_config($config, [ $args ])

+ +

Launches a new i3 process with $config as configuration file. Useful for tests which test specific config file directives.

+
  use i3test i3_autostart => 0;
+
+  my $config = <<EOT;
+  # i3 config file (v4)
+  for_window [class="borderless"] border none
+  for_window [title="special borderless title"] border none
+  EOT
+
+  my $pid = launch_with_config($config);
+
+  # …
+
+  exit_gracefully($pid);
+

get_i3_log

+ +

Returns the content of the log file for the current test.

+ +

kill_all_windows

+ +

Kills all windows to clean up between tests.

+ +

events_for($subscribecb, [ $rettype ], [ $eventcbs ])

+ +

Helper function which returns an array containing all events of type $rettype which were generated by i3 while $subscribecb was running.

+ +

Set $eventcbs to subscribe to multiple event types and/or perform your own event aggregation.

+ +

listen_for_binding($cb)

+ +

Helper function to evaluate whether sending KeyPress/KeyRelease events via XTEST triggers an i3 key binding or not. Expects key bindings to be configured in the form “bindsym <binding> nop <binding>”, e.g. “bindsym Mod4+Return nop Mod4+Return”.

+
  is(listen_for_binding(
+      sub {
+          xtest_key_press(133); # Super_L
+          xtest_key_press(36); # Return
+          xtest_key_release(36); # Return
+          xtest_key_release(133); # Super_L
+          xtest_sync_with_i3;
+      },
+      ),
+     'Mod4+Return',
+     'triggered the "Mod4+Return" keybinding');
+

is_net_wm_state_focused

+ +

Returns true if the given window has the _NET_WM_STATE_FOCUSED atom.

+
    ok(is_net_wm_state_focused($window), '_NET_WM_STATE_FOCUSED set');
+

cmp_tree([ $args ])

+ +

Compares the tree layout before and after an operation inside a subtest.

+ +

The following arguments can be passed:

+ +
+
layout_before
+ +
+

Required argument. The initial layout to be created. For example, 'H[ V[ a* S[ b c ] d ] e ]' or 'V[a b] T[c d*]'. The layout will be converted to a JSON file which will be passed to i3's append_layout command.

+ +

The syntax's rules, assertions and limitations are:

+ +
    +
  1. Upper case letters H, V, S, T mean horizontal, vertical, stacked and tabbed layout respectively. They must be followed by an opening square bracket and must be closed with a closing square bracket. Each of the non-leaf containers is marked with their corresponding letter followed by a number indicating the position of the container relative to other containers of the same type. For example, 'H[V[xxx] V[xxx] H[xxx]]' will mark the non-leaf containers as H1, V1, V2, H2.
  2. + +
  3. Spaces are ignored.
  4. + +
  5. Other alphanumeric characters mean a new window which uses the provided character for its class and name. Eg 'H[a b]' will open windows with classes 'a' and 'b' inside a horizontal split. Windows use a single character for their class, eg 'H[xxx]' will open 3 windows with class 'x'.
  6. + +
  7. Asterisks after a window mean that the window must be focused after the layout is loaded. Currently, focusing non-leaf containers must be done manually, in the callback (cb) function.
  8. +
+ +
cb
+ +
+

Subroutine to be called after the layout provided by layout_before is created but before the resulting layout (layout_after) is checked.

+ +
layout_after
+ +
+

Required argument. The final layout in which the tree is expected to be after the callback is called. Uses the same syntax with layout_before. For non-leaf containers, their layout (horizontal, vertical, stacked, tabbed) is compared with the corresponding letter (H, V, S, T). For leaf containers, their name is compared with the provided alphanumeric.

+ +
ws
+ +
+

The workspace in which the layout will be created. Will switch focus to it. If not provided, a new one is created.

+ +
msg
+ +
+

Message to prepend to the subtest's name. If not empty, it will be followed by ': '.

+ +
dont_kill
+ +
+

By default, all windows are killed before the layout_before layout is loaded. Set to 1 to avoid this.

+
+
+ +

AUTHOR

+ +

Michael Stapelberg <michael@i3wm.org>

+ + + + diff --git a/docs/multi-monitor.html b/docs/multi-monitor.html new file mode 100644 index 0000000..2ee8306 --- /dev/null +++ b/docs/multi-monitor.html @@ -0,0 +1,823 @@ + + + + + + +The multi-monitor situation + + + + + +
+
+
+

Please upgrade your nVidia driver to version 302.17 or newer and i3 will just +work. This document is kept around for historic reasons only.

+
+
+
+

1. The quick fix

+
+

If you are using the nVidia binary graphics driver (also known as blob) +before version 302.17, you need to use the --force-xinerama flag (in your +.xsession) when starting i3, like so:

+
+
Example:
+
+
exec i3 --force-xinerama -V >>~/.i3/i3log 2>&1
+
+

…or use force_xinerama yes in your configuration file.

+
+
+
+

2. The explanation

+
+

Starting with version 3.ε, i3 uses the RandR (Rotate and Resize) API instead +of Xinerama. The reason for this, is that RandR provides more information +about your outputs and connected screens than Xinerama does. To be specific, +the code which handled on-the-fly screen reconfiguration (meaning without +restarting the X server) was a very messy heuristic and most of the time did +not work correctly — that is just not possible with the little information +Xinerama offers (just a list of screen resolutions, no identifiers for the +screens or any additional information). Xinerama simply was not designed +for dynamic configuration.

+

So RandR came along, as a more powerful alternative (RandR 1.2 to be specific). +It offers all of Xinerama’s possibilities and lots more. Using the RandR API +made our code much more robust and clean. Also, you can now reliably assign +workspaces to output names instead of some rather unreliable screen identifier +(position inside the list of screens, which could change, and so on…).

+

As RandR has been around for about three years as of this writing, it seemed +like a very good idea to us, and it still is a very good one. What we did not +expect, however, was the nVidia binary driver. It still does not support RandR +(as of March 2010), even though nVidia has announced that it will support RandR +eventually. What does this mean for you, if you are stuck with the binary +driver for some reason (say the free drivers don’t work with your card)? First +of all, you are stuck with TwinView and cannot use xrandr. While this ruins +the user experience, the more grave problem is that the nVidia driver not only +does not support dynamic configuration using RandR, it also does not expose +correct multi-monitor information via the RandR API. So, in some setups, i3 +will not find any screens; in others, it will find one large screen which +actually contains both of your physical screens (but it will not know that +these are two screens).

+

For this very reason, we decided to implement the following workaround: As +long as the nVidia driver does not support RandR, an option called +--force-xinerama is available in i3 (alternatively, you can use the +force_xinerama configuration file directive). This option gets the list of +screens once when starting, and never updates it. As the nVidia driver cannot +do dynamic configuration anyways, this is not a big deal.

+

Also note that your output names are not descriptive (like HDMI1) when using +Xinerama, instead they are counted up, starting at 0: xinerama-0, xinerama-1, …

+
+
+
+

3. See also

+
+

For more information on how to use multi-monitor setups, see the i3 User’s +Guide.

+
+
+
+

+ + + diff --git a/docs/testsuite.html b/docs/testsuite.html new file mode 100644 index 0000000..9a4e0bb --- /dev/null +++ b/docs/testsuite.html @@ -0,0 +1,1441 @@ + + + + + + +i3 testsuite + + + + + +
+
+
+

This document explains how the i3 testsuite works, how to use it and extend it. +It is targeted at developers who not necessarily have been doing testing before +or have not been testing in Perl before. In general, the testsuite is not of +interest for end users.

+
+
+
+

1. Introduction

+
+

The i3 testsuite is a collection of files which contain testcases for various +i3 features. Some of them test if a certain workflow works correctly (moving +windows, focus behaviour, …). Others are regression tests and contain code +which previously made i3 crash or lead to unexpected behaviour. They then check +if i3 still runs (meaning it did not crash) and if it handled everything +correctly.

+

The goal of having these tests is to automatically find problems and to +automatically get a feel for whether a change in the source code breaks any +existing feature. After every modification of the i3 sourcecode, the developer +should run the full testsuite. If one of the tests fails, the corresponding +problem should be fixed (or, in some cases, the testcase has to be modified). +For every bugreport, a testcase should be written to test the correct +behaviour. Initially, it will fail, but after fixing the bug, it will pass. +This ensures (or increases the chance) that bugs which have been fixed once +will never be found again.

+

Also, when implementing a new feature, a testcase might be a good way to be +able to easily test if the feature is working correctly. Many developers will +test manually if everything works. Having a testcase not only helps you with +that, but it will also be useful for every future change.

+
+
+
+

2. Relevant documentation

+
+

Apart from this document, you should also have a look at:

+
    +
  1. +

    +The "Modern Perl" book, which can be found at + http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf +

    +
  2. +
  3. +

    +The latest Perl documentation of the "i3test" (general testcase setup) and + "i3test::Test" (additional test instructions) modules: + https://build.i3wm.org/docs/lib-i3test.html respectively + https://build.i3wm.org/docs/lib-i3test-test.html +

    +
  4. +
  5. +

    +The latest documentation on i3’s IPC interface: + https://build.i3wm.org/docs/ipc.html +

    +
  6. +
+
+
+
+

3. Implementation

+
+

For several reasons, the i3 testsuite has been implemented in Perl:

+
    +
  1. +

    +Perl has a long tradition of testing. Every popular/bigger Perl module which + you can find on CPAN will not only come with documentation, but also with + tests. Therefore, the available infrastructure for tests is comprehensive. + See for example the excellent http://search.cpan.org/perldoc?Test::More + and the referenced http://search.cpan.org/perldoc?Test::Tutorial. +

    +
  2. +
  3. +

    +Perl is widely available and has a well-working package infrastructure. +

    +
  4. +
  5. +

    +The author is familiar with Perl :). +

    +
  6. +
  7. +

    +It is a good idea to use a different language for the tests than the + implementation itself. +

    +
  8. +
+

Please do not start programming language flamewars at this point.

+
+

3.1. Installing the dependencies

+

As usual with Perl programs, the testsuite ships with a Makefile.PL. +This file specifies which Perl modules the testsuite depends on and can be used +to install all of them.

+

Perl modules are distributed via CPAN, and there is the official, standard CPAN +client, simply called cpan. It comes with every Perl installation and can be +used to install the testsuite. Many users prefer to use the more modern +cpanminus instead, though (because it asks no questions and just works):

+

The tests additionally require Xephyr(1) to run a nested X server. Install +xserver-xephyr on Debian or xorg-server-xephyr on Arch Linux.

+
+
Installing testsuite dependencies using cpanminus (preferred)
+
+
$ cd ~/i3/testcases
+$ sudo apt-get install cpanminus
+$ sudo cpanm .
+$ cd ~/i3/AnyEvent-I3
+$ sudo cpanm Module::Install
+$ sudo cpanm .
+
+

If you don’t want to use cpanminus for some reason, the same works with cpan:

+
+
Installing testsuite dependencies using cpan
+
+
$ cd ~/i3/testcases
+$ sudo cpan .
+$ cd ~/i3/AnyEvent-I3
+$ sudo cpan Module::Install
+$ sudo cpan .
+
+

In case you don’t have root permissions, you can also install into your home +directory, see https://michael.stapelberg.de/cpan/

+
+
+

3.2. Mechanisms

+
+

3.2.1. Script: complete-run

+

The testcases are run by a script called complete-run.pl. It runs all +testcases by default, but you can be more specific and let it only run one or +more testcases. Also, it takes care of starting up a separate instance of i3 +with an appropriate configuration file and creates a folder for each run +containing the appropriate i3 logfile for each testcase. The latest folder can +always be found under the symlink latest/. Unless told differently, it will +run the tests on a separate X server instance (using Xephyr).

+

Xephyr will open a window where you can inspect the running test. By default, +tests are run under Xvfb.

+
+
Example invocation of complete-run.pl
+
+
$ cd ~/i3
+
+$ autoreconf -fi
+
+$ mkdir -p build && cd build
+
+$ ../configure
+
+$ make -j8
+# output omitted because it is very long
+
+$ cd testcases
+
+$ ./complete-run.pl
+# output omitted because it is very long
+All tests successful.
+Files=78, Tests=734, 27 wallclock secs ( 0.38 usr  0.48 sys + 17.65 cusr  3.21 csys = 21.72 CPU)
+Result: PASS
+
+$ ./complete-run.pl t/04-floating.t
+[:3] i3 startup: took 0.07s, status = 1
+[:3] Running t/04-floating.t with logfile testsuite-2011-09-24-16-06-04-4.0.2-226-g1eb011a/i3-log-for-04-floating.t
+[:3] t/04-floating.t finished
+[:3] killing i3
+output for t/04-floating.t:
+ok 1 - use X11::XCB::Window;
+ok 2 - The object isa X11::XCB::Window
+ok 3 - Window is mapped
+ok 4 - i3 raised the width to 75
+ok 5 - i3 raised the height to 50
+ok 6 - i3 did not map it to (0x0)
+ok 7 - The object isa X11::XCB::Window
+ok 8 - i3 let the width at 80
+ok 9 - i3 let the height at 90
+ok 10 - i3 mapped it to x=1
+ok 11 - i3 mapped it to y=18
+ok 12 - The object isa X11::XCB::Window
+ok 13 - i3 let the width at 80
+ok 14 - i3 let the height at 90
+1..14
+
+All tests successful.
+Files=1, Tests=14,  0 wallclock secs ( 0.01 usr  0.00 sys +  0.19 cusr  0.03 csys =  0.23 CPU)
+Result: PASS
+
+$ less latest/i3-log-for-04-floating.t
+
+

If your attempt to run the tests with a bare call to ./complete-run.pl fails, try this:

+
+
+
$ ./complete-run.pl --parallel=1 --keep-xserver-output
+
+

This will show the output of Xephyr, which is the X server implementation we +use for testing.

+
+
make command: make check
+

Make check runs the i3 testsuite. +You can still use ./testcases/complete-run.pl to get the interactive progress output.

+
+
Example invocation of make check
+
+
$ cd ~/i3
+
+$ autoreconf -fi
+
+$ mkdir -p build && cd build
+
+$ ../configure
+
+$ make -j8
+# output omitted because it is very long
+
+$ make check
+# output omitted because it is very long
+PASS: testcases/complete-run.pl
+============================================================================
+Testsuite summary for i3 4.13
+============================================================================
+# TOTAL: 1
+# PASS:  1
+# SKIP:  0
+# XFAIL: 0
+# FAIL:  0
+# XPASS: 0
+# ERROR: 0
+============================================================================
+
+$ less test-suite.log
+
+
+
+
+

3.2.2. Coverage testing

+

Coverage testing is possible with lcov, the front-end for GCC’s coverage +testing tool gcov. The testcases can generate a nice html report that tells +you which functions and lines were covered during a run of the tests. You can +use this tool to judge how effective your tests are.

+

To use test coverage tools, first compile with coverage enabled.

+
+
+
COVERAGE=1 make
+
+

Then run the tests with the --coverage-testing flag.

+
+
+
./complete-run.pl --coverage-testing
+
+

Then open latest/i3-coverage/index.html in your web browser.

+
+
+

3.2.3. IPC interface

+

The testsuite makes extensive use of the IPC (Inter-Process Communication) +interface which i3 provides. It is used for the startup process of i3, for +terminating it cleanly and (most importantly) for modifying and getting the +current state (layout tree).

+

See [https://i3wm.org/docs/ipc.html] for documentation on the IPC interface.

+
+
+

3.2.4. X11::XCB

+

In order to open new windows, change attributes, get events, etc., the +testsuite uses X11::XCB, a new (and quite specific to i3 at the moment) Perl +module which uses the XCB protocol description to generate Perl bindings to +X11. They work in a very similar way to libxcb (which i3 uses) and provide +relatively high-level interfaces (objects such as X11::XCB::Window) as well as +access to the low-level interface, which is very useful when testing a window +manager.

+
+
+
+

3.3. Filesystem structure

+

In the git root of i3, the testcases live in the folder testcases. This +folder contains the complete-run.pl and a base configuration file which will +be used for the tests. The different testcases (their file extension is .t, not +.pl) themselves can be found in the conventionally named subfolder t:

+
+
Filesystem structure
+
+
├── testcases
+│   ├── complete-run.pl
+│   ├── i3-test.config
+│   ├── lib
+│   │   ├── i3test.pm
+│   │   ├── SocketActivation.pm
+│   │   └── StartXDummy.pm
+│   ├── t
+│   │   ├── 00-load.t
+│   │   ├── 01-tile.t
+│   │   ├── 02-fullscreen.t
+│   │   ├── ...
+│   │   ├── omitted for brevity
+│   │   ├── ...
+│   │   └── 74-regress-focus-toggle.t
+
+
+
+
+
+

4. Anatomy of a testcase

+
+

Learning by example is definitely a good strategy when you are wondering how to +write a testcase. Let’s take t/11-goto.t as an easy example and go through it +step by step:

+
+
t/11-goto.t: Boilerplate
+
+
#!perl
+# vim:ts=4:sw=4:expandtab
+
+use i3test;
+use File::Temp;
+
+my $x = X11::XCB::Connection->new;
+
+

This is what we call boilerplate. It exists at the top of every test file (to +some extent). The first line is the shebang, which specifies that this file is +a Perl script. The second line contains VIM specific settings on how to +edit/format this file (use spaces instead of tabs, indent using 4 spaces). +Afterwards, the i3test module is used. This module contains i3 testsuite +specific functions which you are strongly encouraged to use. They make writing +testcases a lot easier and will make it easier for other people to read your +tests.

+

The next line uses the File::Temp module. This is specific to this testcase, +because it needs to generate a temporary name during the test. Many testcases +use only the i3test module.

+

The last line opens a connection to X11. You might or might not need this in +your testcase, depending on whether you are going to open windows (etc.) or +only use i3 commands.

+
+
t/11-goto.t: Setup
+
+
my $tmp = fresh_workspace;
+
+cmd 'split h';
+
+

The first line calls i3test’s fresh_workspace function which looks for a +currently unused workspace, switches to it, and returns its name. The variable +$tmp will end up having a value such as "/tmp/87kBVcHbA9". Note that this +is not (necessarily) a valid path, it’s just a random workspace name.

+

So, now that we are on a new workspace, we ensure that the workspace uses +horizontal orientation by issuing the split h command (see the i3 User’s +Guide for a list of commands). This is not strictly necessary, but good style. +In general, the cmd function executes the specified i3 command by using the +IPC interface and returns once i3 acknowledged the command.

+
+
t/11-goto.t: Setup
+
+
#####################################################################
+# Create two windows and make sure focus switching works
+#####################################################################
+
+my $top = open_window($x);
+my $mid = open_window($x);
+my $bottom = open_window($x);
+
+

In every major section of a testcase, you should put a comment like the one +above. This makes it immediately clear how the file is structured.

+

The open_window function opens a standard window, which will then be put into +tiling mode by i3. If you want a floating window, use the +open_floating_window function. These functions accept the same parameters as +X11::XCB::Window→new, see the i3test documentation at TODO.

+
+
t/11-goto.t: Helper function
+
+
#
+# Returns the input focus after sending the given command to i3 via IPC
+# and syncing with i3
+#
+sub focus_after {
+    my $msg = shift;
+
+    cmd $msg;
+    sync_with_i3 $x;
+    return $x->input_focus;
+}
+
+

This section defines a helper function which will be used over and over in this +testcase. If you have code which gets executed more than once or twice +(depending on the length of your test, use your best judgement), please put it +in a function. Tests should be short, concise and clear.

+

The focus_after function executes a command and returns the X11 focus after +the command was executed. The sync_with_i3 command makes sure that i3 could +push its state to X11. See [i3_sync] to learn how this works exactly.

+
+
t/11-goto.t: Test assumptions
+
+
$focus = $x->input_focus;
+is($focus, $bottom->id, "Latest window focused");
+
+$focus = focus_after('focus left');
+is($focus, $mid->id, "Middle window focused");
+
+

Now, we run the first two real tests. They use Test::More's is function, +which compares two values and prints the differences if they are not the same. +After the arguments, we supply a short comment to indicate what we are testing +here. This makes it vastly more easy for the developer to spot which testcase +is the problem in case one fails.

+

The first test checks that the most recently opened window is focused. +Afterwards, the command focus left is issued and it is verified that the +middle window now has focus.

+

Note that this is not a comprehensive test of the focus command — we would +have to test wrapping, focus when using a more complex layout, focusing the +parent/child containers, etc. But that is not the point of this testcase. +Instead, we just want to know if $x→input_focus corresponds with what we are +expecting. If not, something is completely wrong with the test environment and +this trivial test will fail.

+
+
t/11-goto.t: Test that the feature does not work (yet)
+
+
#####################################################################
+# Now goto a mark which does not exist
+#####################################################################
+
+my $random_mark = mktemp('mark.XXXXXX');
+
+$focus = focus_after(qq|[con_mark="$random_mark"] focus|);
+is($focus, $mid->id, "focus unchanged");
+
+

Syntax hint: The qq keyword is the interpolating quote operator. It lets you +chose a quote character (in this case the | character, a pipe). This makes +having double quotes in our string easy.

+

In this new major section, a random mark (mark is an identifier for a window, +see "VIM-like marks" in the i3 User’s Guide) will be generated. Afterwards, we +test that trying to focus that mark will not do anything. This is important: Do +not only test that using a feature has the expected outcome, but also test that +using it without properly initializing it does no harm. This command could for +example have changed focus anyways (a bug) or crash i3 (obviously a bug).

+
+
t/11-goto.t: Test that the feature does work
+
+
cmd "mark $random_mark";
+
+$focus = focus_after('focus left');
+is($focus, $top->id, "Top window focused");
+
+$focus = focus_after(qq|[con_mark="$random_mark"] focus|);
+is($focus, $mid->id, "goto worked");
+
+

Remember: Focus was on the middle window (we verified that earlier in "Test +assumptions"). We now mark the middle window with our randomly generated mark. +Afterwards, we switch focus away from the middle window to be able to tell if +focusing it via its mark will work. If the test works, the goto command seems +to be working.

+
+
t/11-goto.t: Test corner case
+
+
# check that we can specify multiple criteria
+
+$focus = focus_after('focus left');
+is($focus, $top->id, "Top window focused");
+
+$focus = focus_after(qq|[con_mark="$random_mark" con_mark="$random_mark"] focus|);
+is($focus, $mid->id, "goto worked");
+
+

Now we test the same feature, but specifying the mark twice in the command. +This should have no effect, but let’s be sure: test it and see if things go +wrong.

+
+
t/11-goto.t: Test second code path
+
+
#####################################################################
+# Check whether the focus command will switch to a different
+# workspace if necessary
+#####################################################################
+
+my $tmp2 = fresh_workspace;
+
+is(focused_ws(), $tmp2, 'tmp2 now focused');
+
+cmd qq|[con_mark="$random_mark"] focus|;
+
+is(focused_ws(), $tmp, 'tmp now focused');
+
+

This part of the test checks that focusing windows by mark works across +workspaces. It uses i3test’s focused_ws function to get the current +workspace.

+
+
t/11-goto.t: Test second code path
+
+
done_testing;
+
+

The end of every testcase has to contain the done_testing line. This tells +complete-run.pl that the test was finished successfully. If it does not +occur, the test might have crashed during execution — some of the reasons why +that could happen are bugs in the used modules, bugs in the testcase itself or +an i3 crash resulting in the testcase being unable to communicate with i3 via +IPC anymore.

+
+
+
+

5. Appendix A: The i3 sync protocol

+
+

Consider the following situation: You open two windows in your testcase, then +you use focus left and want to verify that the X11 focus has been updated +properly. Sounds simple, right? Let’s assume you use this straight-forward +implementation:

+
+
Racey focus testcase
+
+
my $left = open_window($x);
+my $right = open_window($x);
+cmd 'focus left';
+is($x->input_focus, $left->id, 'left window focused');
+
+

However, the test fails. Sometimes. Apparently, there is a race condition in +your test. If you think about it, this is because you are using two different +pieces of software: You tell i3 to update focus, i3 confirms that, and then you +ask X11 to give you the current focus. There is a certain time i3 needs to +update the X11 state. If the testcase gets CPU time before X11 processed i3’s +requests, the test will fail.

+
+
+Diagram of the race condition +
+
Figure 1. Diagram of the race condition
+
+

One way to "solve" this would be to add sleep 0.5; after the cmd call. +After 0.5 seconds it should be safe to assume that focus has been updated, +right?

+

In practice, this usually works. However, it has several problems:

+
    +
  1. +

    +This is obviously not a clean solution, but a workaround. Ugly. +

    +
  2. +
  3. +

    +On very slow machines, this might not work. Unlikely, but in different + situations (a delay to wait for i3 to startup) the necessary time is much + harder to guess, even for fast machines. +

    +
  4. +
  5. +

    +This wastes a lot of time. Usually, your computer is much faster than 0.5s + to update the status. However, sometimes, it might take 0.4s, so we can’t + make it sleep 0.1. +

    +
  6. +
+

To illustrate how grave the problem with wasting time actually is: Before +removing all sleeps from the testsuite, a typical run using 4 separate X +servers took around 50 seconds on my machine. After removing all the sleeps, +we achieved times of about 25 seconds. This is very significant and influences +the way you think about tests — the faster they are, the more likely you are +to check whether everything still works quite often (which you should).

+

What I am trying to say is: Delays adds up quickly and make the test suite +less robust.

+

The real solution for this problem is a mechanism which I call "the i3 sync +protocol". The idea is to send a request (which does not modify state) via X11 +to i3 which will then be answered. Due to the request’s position in the event +queue (after all previous events), you can be sure that by the time you +receive the reply, all other events have been dealt with by i3 (and, more +importantly, X11).

+
+
+Diagram of the i3 sync solution +
+
Figure 2. Diagram of the i3 sync solution
+
+
+

5.1. Implementation details

+

The client which wants to sync with i3 initiates the protocol by sending a +ClientMessage to the X11 root window:

+
+
Send ClientMessage
+
+
# Generate a ClientMessage, see xcb_client_message_t
+my $msg = pack "CCSLLLLLLL",
+    CLIENT_MESSAGE, # response_type
+    32,     # format
+    0,      # sequence
+    $root,  # destination window
+    $x->atom(name => 'I3_SYNC')->id,
+
+    $_sync_window->id,    # data[0]: our own window id
+    $myrnd, # data[1]: a random value to identify the request
+    0,
+    0,
+    0;
+
+# Send it to the root window -- since i3 uses the SubstructureRedirect
+# event mask, it will get the ClientMessage.
+$x->send_event(0, $root, EVENT_MASK_SUBSTRUCTURE_REDIRECT, $msg);
+
+

i3 will then reply with the same ClientMessage, sent to the window specified in +data[0]. In the reply, data[0] and data[1] are exactly the same as in the +request. You should use a random value in data[1] and check that you received +the same one when getting the reply.

+
+
+
+
+

6. Appendix B: Socket activation

+
+

Socket activation is a mechanism which was made popular by systemd, an init +replacement. It basically describes creating a listening socket before starting +a program. systemd will invoke the program only when an actual connection to +the socket is made, hence the term socket activation.

+

The interesting part of this (in the i3 context) is that you can very precisely +detect when the program is ready (finished its initialization).

+
+

6.1. Preparing the listening socket

+

complete-run.pl will create a listening UNIX socket which it will then pass +to i3. This socket will be used by i3 as an additional IPC socket, just like +the one it will create on its own. Passing the socket happens implicitly +because children will inherit the parent’s sockets when fork()ing and sockets +will continue to exist after an exec() call (unless CLOEXEC is set of course).

+

The only explicit things complete-run.pl has to do is setting the LISTEN_FDS +environment variable to the number of sockets which exist (1 in our case) and +setting the LISTEN_PID environment variable to the current process ID. Both +variables are necessary so that the program (i3) knows how many sockets it +should use and if the environment variable is actually intended for it. i3 will +then start looking for sockets at file descriptor 3 (since 0, 1 and 2 are used +for stdin, stdout and stderr, respectively).

+

The actual Perl code which sets up the socket, fork()s, makes sure the socket +has file descriptor 3 and sets up the environment variables follows (shortened +a bit):

+
+
Setup socket and environment
+
+
my $socket = IO::Socket::UNIX->new(
+    Listen => 1,
+    Local => $args{unix_socket_path},
+);
+
+my $pid = fork;
+if ($pid == 0) {
+    $ENV{LISTEN_PID} = $$;
+    $ENV{LISTEN_FDS} = 1;
+
+    # Only pass file descriptors 0 (stdin), 1 (stdout),
+    # 2 (stderr) and 3 (socket) to the child.
+    $^F = 3;
+
+    # If the socket does not use file descriptor 3 by chance
+    # already, we close fd 3 and dup2() the socket to 3.
+    if (fileno($socket) != 3) {
+        POSIX::close(3);
+        POSIX::dup2(fileno($socket), 3);
+    }
+
+    exec "/usr/bin/i3";
+}
+
+
+
+

6.2. Waiting for a reply

+

In the parent process, we want to know when i3 is ready to answer our IPC +requests and handle our windows. Therefore, after forking, we immediately close +the listening socket (i3 will handle this side of the socket) and connect to it +(remember, we are talking about a named UNIX socket) as a client. This connect +call will immediately succeed because the kernel buffers it. Then, we send a +request (of type GET_TREE, but that is not really relevant). Writing data to +the socket will also succeed immediately because, again, the kernel buffers it +(only up to a certain amount of data of course).

+

Afterwards, we just blockingly wait until we get an answer. In the child +process, i3 will setup the listening socket in its event loop. Immediately +after actually starting the event loop, it will notice a new client connecting +(the parent process) and handle its request. Since all initialization has been +completed successfully by the time the event loop is entered, we can now assume +that i3 is ready.

+
+
+

6.3. Timing and conclusion

+

A beautiful feature of this mechanism is that it does not depend on timing. It +does not matter when the child process gets CPU time or when the parent process +gets CPU time. On heavily loaded machines (or machines with multiple CPUs, +cores or unreliable schedulers), this makes waiting for i3 much more robust.

+

Before using socket activation, we typically used a sleep(1) and hoped that +i3 was initialized by that time. Of course, this breaks on some (slow) +computers and wastes a lot of time on faster computers. By using socket +activation, we decreased the total amount of time necessary to run all tests +(72 files at the time of writing) from > 100 seconds to 16 seconds. This makes +it significantly more attractive to run the test suite more often (or at all) +during development.

+

An alternative approach to using socket activation is polling for the existence +of the IPC socket and connecting to it. While this might be slightly easier to +implement, it wastes CPU time and is considerably uglier than this solution +:). After all, lib/SocketActivation.pm contains only 54 SLOC.

+
+
+
+
+

+ + + diff --git a/docs/userguide.html b/docs/userguide.html new file mode 100644 index 0000000..df2ebfc --- /dev/null +++ b/docs/userguide.html @@ -0,0 +1,3909 @@ + + + + + + +i3 User’s Guide + + + + + +
+
+
+

This document contains all the information you need to configure and use the i3 +window manager. If it does not, please check https://www.reddit.com/r/i3wm/ +first, then contact us on IRC (preferred) or post your question(s) on the +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):

+

Keys to use with $mod (Alt):

+

+ +Keys to use with $mod (Alt) + +

+

Keys to use with Shift+$mod:

+

+ +Keys to use with Shift+$mod + +

+

The red keys are the modifiers you need to press (by default), the blue keys +are your homerow.

+

Note that when starting i3 without a config file, i3-config-wizard will offer +you to create a config file in which the key positions (!) match what you see +in the image above, regardless of the keyboard layout you are using. If you +prefer to use a config file where the key letters match what you are seeing +above, just decline i3-config-wizard’s offer and base your config on +/etc/i3/config.

+
+
+
+

2. Using i3

+
+

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 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 +for this is $mod+Enter, that is Alt+Enter (Mod1+Enter) in the default +configuration. By pressing $mod+Enter, a new terminal will be opened. It +will fill the whole space available on your screen.

+

+Single terminal +

+

If you now open another terminal, i3 will place it next to the current one, +splitting the screen size in half. Depending on your monitor, i3 will put the +created window beside the existing window (on wide displays) or below the +existing window (rotated displays).

+

+Two terminals +

+

To move the focus between the two terminals, you can use the direction keys +which you may know from the editor vi. However, in i3, your homerow is used +for these keys (in vi, the keys are shifted to the left by one for +compatibility with most keyboard layouts). Therefore, $mod+j is left, $mod+k +is down, $mod+l is up and $mod+; is right. So, to switch between the +terminals, use $mod+k or $mod+l. Of course, you can also use the arrow keys.

+

At the moment, your workspace is split (it contains two terminals) in a +specific direction (horizontal by default). Every window can be split +horizontally or vertically again, just like the workspace. The terminology is +"window" for a container that actually contains an X11 window (like a terminal +or browser) and "split container" for containers that consist of one or more +windows.

+

TODO: picture of the tree

+

To split a window vertically, press $mod+v before you create the new window. +To split it horizontally, press $mod+h.

+
+
+

2.2. Changing the container layout

+

A split container can have one of the following layouts:

+
+
+splith/splitv +
+
+

+Windows are sized so that every window gets an equal amount of space in the +container. splith distributes the windows horizontally (windows are right next +to each other), splitv distributes them vertically (windows are on top of each +other). +

+
+
+stacking +
+
+

+Only the focused window in the container is displayed. You get a list of +windows at the top of the container. +

+
+
+tabbed +
+
+

+The same principle as stacking, but the list of windows at the top is only +a single line which is vertically split. +

+
+
+

To switch modes, press $mod+e for splith/splitv (it toggles), $mod+s for +stacking and $mod+w for tabbed.

+

+Container modes +

+
+
+

2.3. Toggling fullscreen mode for a window

+

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 toggle global).

+
+
+

2.4. Opening other applications

+

Aside from opening applications from a terminal, you can also use the handy +dmenu which is opened by pressing $mod+d by default. Just type the name +(or a part of it) of the application which you want to open. The corresponding +application has to be in your $PATH for this to work.

+

Additionally, if you have applications you open very frequently, you can +create a keybinding for starting the application directly. See the section +[configuring] for details.

+
+
+

2.5. Closing windows

+

If an application does not provide a mechanism for closing (most applications +provide a menu, the escape key or a shortcut like Control+w to close), you +can press $mod+Shift+q to kill a window. For applications which support +the WM_DELETE protocol, this will correctly close the application (saving +any modifications or doing other cleanup). If the application doesn’t support +the WM_DELETE protocol your X server will kill the window and the behaviour +depends on the application.

+
+
+

2.6. Using workspaces

+

Workspaces are an easy way to group a set of windows. By default, you are on +the first workspace, as the bar on the bottom left indicates. To switch to +another workspace, press $mod+num where num is the number of the workspace +you want to use. If the workspace does not exist yet, it will be created.

+

A common paradigm is to put the web browser on one workspace, communication +applications (mutt, irssi, …) on another one, and the ones with which you +work, on the third one. Of course, there is no need to follow this approach.

+

If you have multiple screens, a workspace will be created on each screen at +startup. If you open a new workspace, it will be bound to the screen you +created it on. When you switch to a workspace on another screen, i3 will set +focus to that screen.

+
+
+

2.7. Moving windows to workspaces

+

To move a window to another workspace, simply press $mod+Shift+num where +num is (like when switching workspaces) the number of the target workspace. +Similarly to switching workspaces, the target workspace will be created if +it does not yet exist.

+
+
+

2.8. Resizing

+

The easiest way to resize a container is by using the mouse: Grab the border +and move it to the wanted size.

+

You can also use [binding_modes] to define a mode for resizing via the +keyboard. To see an example for this, look at the +default config provided +by i3.

+
+
+

2.9. Restarting i3 inplace

+

To restart i3 in place (and thus get into a clean state if there is a bug, or +to upgrade to a newer version of i3) you can use $mod+Shift+r.

+
+
+

2.10. 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.

+
+
+

2.11. Floating

+

Floating mode is the opposite of tiling mode. The position and size of +a window are not managed automatically by i3, but manually by +you. Using this mode violates the tiling paradigm but can be useful +for some corner cases like "Save as" dialog windows, or toolbar +windows (GIMP or similar). Those windows usually set the appropriate +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]. 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 the resizing binding mode +provided by the i3 default config.

+

Floating windows are always on top of tiling windows.

+
+
+
+
+

3. Tree

+
+

i3 stores all information about the X11 outputs, workspaces and layout of the +windows on them in a tree. The root node is the X11 root window, followed by +the X11 outputs, then dock areas and a content container, then workspaces and +finally the windows themselves. In previous versions of i3 we had multiple lists +(of outputs, workspaces) and a table for each workspace. That approach turned +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 +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 +single workspace and you open two terminal windows, you will end up with a tree +like this:

+
+
+layout2 +
+
+
+
+shot4 +
+
Figure 1. Two terminals on standard workspace
+
+
+
+

3.2. Orientation and Split Containers

+

It is only natural to use so-called Split Containers in order to build a +layout when using a tree as data structure. In i3, every Container has an +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+v in the default config) +and then open two terminals, i3 will configure your windows like this:

+
+
+shot2 +
+
Figure 2. Vertical Workspace Orientation
+
+

An interesting new feature of i3 since version 4 is the ability to split anything: +Let’s assume you have two terminals on a workspace (with splith layout, that is +horizontal orientation), focus is on the right terminal. Now you want to open +another terminal window below the current one. If you would just open a new +terminal window, it would show up to the right due to the splith layout. +Instead, press $mod+v to split the container with the splitv layout (to +open a Horizontal Split Container, use $mod+h). Now you can open a new +terminal and it will open below the current one:

+
+
+Layout +
+
+
+
+shot +
+
Figure 3. Vertical Split Container
+
+
+

You probably guessed it already: There is no limit on how deep your hierarchy +of splits can be.

+
+
+

3.3. Focus parent

+

Let’s stay with our example from above. We have a terminal on the left and two +vertically split terminals on the right, focus is on the bottom right one. When +you open a new terminal, it will open below the current one.

+

So, how can you open a new terminal window to the right of the current one? +The solution is to use focus parent, which will focus the Parent Container of +the current Container. In default configuration, use $mod+a to navigate one +Container up the tree (you can repeat this multiple times until you get to the +Workspace Container). In this case, you would focus the Vertical Split Container +which is inside the horizontally oriented workspace. Thus, now new windows will be +opened to the right of the Vertical Split Container:

+
+
+shot3 +
+
Figure 4. Focus parent, then open new terminal
+
+
+
+

3.4. Implicit containers

+

In some cases, i3 needs to implicitly create a container to fulfill your +command.

+

One example is the following scenario: You start i3 with a single monitor and a +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+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 with a representation of the split +container (e.g., "H[urxvt firefox]") and the other one being the terminal window +you moved down.

+
+
+
+
+

4. Configuring i3

+
+

This is where the real fun begins ;-). Most things are very dependent on your +ideal working environment so we can’t make reasonable defaults for them.

+

While not using a programming language for the configuration, i3 stays +quite flexible in regards to the things you usually want your window manager +to do.

+

For example, you can configure bindings to jump to specific windows, +you can set specific applications to start on specific workspaces, you can +automatically start applications, you can change the colors of i3, and you +can bind your keys to do useful things.

+

To change the configuration of i3, copy /etc/i3/config to ~/.i3/config +(or ~/.config/i3/config if you like the XDG directory scheme) and edit it +with a text editor.

+

On first start (and on all following starts, unless you have a configuration +file), i3 will offer you to create a configuration file. You can tell the +wizard to use either Alt (Mod1) or Windows (Mod4) as modifier in the config +file. Also, the created config file will use the key symbols of your current +keyboard layout. To start the wizard, use the command i3-config-wizard. +Please note that you must not have ~/.i3/config, otherwise the wizard will +exit.

+

Since i3 4.0, a new configuration format is used. i3 will try to automatically +detect the format version of a config file based on a few different keywords, +but if you want to make sure that your config is read with the new format, +include the following line in your config file:

+
+
+
# i3 config file (v4)
+
+
+

4.1. Comments

+

It is possible and recommended to use comments in your configuration file to +properly document your setup for later reference. Comments are started with +a # and can only be used at the beginning of a line:

+

Examples:

+
+
+
# This is a comment
+
+
+
+

4.2. Fonts

+

i3 has support for both X core fonts and FreeType fonts (through Pango) to +render window titles.

+

To generate an X core font description, you can use xfontsel(1). To see +special characters (Unicode), you need to use a font which supports the +ISO-10646 encoding.

+

A FreeType font description is composed by a font family, a style, a weight, +a variant, a stretch and a size. +FreeType fonts support right-to-left rendering and contain often more +Unicode glyphs than X core fonts.

+

If i3 cannot open the configured font, it will output an error in the logfile +and fall back to a working font.

+

Syntax:

+
+
+
font <X core font description>
+font pango:<family list> [<style options>] <size>
+
+

Examples:

+
+
+
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+font pango:DejaVu Sans Mono 10
+font pango:DejaVu Sans Mono, Terminus Bold Semi-Condensed 11
+font pango:Terminus 11px
+
+
+
+

4.3. Keyboard bindings

+

A keyboard binding makes i3 execute a command (see below) upon pressing a +specific key. i3 allows you to bind either on keycodes or on keysyms (you can +also mix your bindings, though i3 will not protect you from overlapping ones).

+
    +
  • +

    +A keysym (key symbol) is a description for a specific symbol, like "a" + or "b", but also more strange ones like "underscore" instead of "_". These + are the ones you use in Xmodmap to remap your keys. To get the current + mapping of your keys, use xmodmap -pke. To interactively enter a key and + see what keysym it is configured to, use xev. +

    +
  • +
  • +

    +Keycodes do not need to have a symbol assigned (handy for custom vendor + hotkeys on some notebooks) and they will not change their meaning as you + switch to a different keyboard layout (when using xmodmap). +

    +
  • +
+

My recommendation is: If you often switch keyboard layouts but you want to keep +your bindings in the same physical location on the keyboard, use keycodes. +If you don’t switch layouts, and want a clean and simple config file, use +keysyms.

+

Some tools (such as import or xdotool) might be unable to run upon a +KeyPress event, because the keyboard/pointer is still grabbed. For these +situations, the --release flag can be used, which will execute the command +after the keys have been released.

+

Syntax:

+
+
+
bindsym [--release] [<Group>+][<Modifiers>+]<keysym> command
+bindcode [--release] [<Group>+][<Modifiers>+]<keycode> command
+
+

Examples:

+
+
+
# Fullscreen
+bindsym $mod+f fullscreen toggle
+
+# Restart
+bindsym $mod+Shift+r restart
+
+# Notebook-specific hotkeys
+bindcode 214 exec --no-startup-id /home/michael/toggle_beamer.sh
+
+# Simulate ctrl+v upon pressing $mod+x
+bindsym --release $mod+x exec --no-startup-id xdotool key --clearmodifiers ctrl+v
+
+# Take a screenshot upon pressing $mod+x (select an area)
+bindsym --release $mod+x exec --no-startup-id import /tmp/latest-screenshot.png
+
+

Available Modifiers:

+
+
+Mod1-Mod5, Shift, Control +
+
+

+Standard modifiers, see xmodmap(1) +

+
+
+Group1, Group2, Group3, Group4 +
+
+

+When using multiple keyboard layouts (e.g. with setxkbmap -layout us,ru), you +can specify in which XKB group (also called “layout”) a keybinding should be +active. By default, keybindings are translated in Group1 and are active in all +groups. If you want to override keybindings in one of your layouts, specify the +corresponding group. For backwards compatibility, the group “Mode_switch” is an +alias for Group2. +

+
+
+
+
+

4.4. 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] [--border] [--whole-window] [--exclude-titlebar] [<Modifiers>+]button<n> command
+
+

By default, the binding will only run when you click on the titlebar of the +window. If the --release flag is given, it will run when the mouse button +is released.

+

If the --whole-window flag is given, the binding will also run when any part +of the window is clicked, with the exception of the border. To have a bind run +when the border is clicked, specify the --border flag.

+

If the --exclude-titlebar flag is given, the titlebar will not be considered +for the keybinding.

+

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
+
+
+
+

4.5. Binding modes

+

You can have multiple sets of bindings by using different binding modes. When +you switch to another binding mode, all bindings from the current mode are +released and only the bindings defined in the new mode are valid for as long as +you stay in that binding mode. The only predefined binding mode is default, +which is the mode i3 starts out with and to which all bindings not defined in a +specific binding mode belong.

+

Working with binding modes consists of two parts: defining a binding mode and +switching to it. For these purposes, there are one config directive and one +command, both of which are called mode. The directive is used to define the +bindings belonging to a certain binding mode, while the command will switch to +the specified mode.

+

It is recommended to use binding modes in combination with [variables] in +order to make maintenance easier. Below is an example of how to use a binding +mode.

+

Note that it is advisable to define bindings for switching back to the default +mode.

+

Note that it is possible to use [pango_markup] for binding modes, but you +need to enable it explicitly by passing the --pango_markup flag to the mode +definition.

+

Syntax:

+
+
+
# config directive
+mode [--pango_markup] <name>
+
+# command
+mode <name>
+
+

Example:

+
+
+
# Press $mod+o followed by either f, t, Escape or Return to launch firefox,
+# thunderbird or return to the default mode, respectively.
+set $mode_launcher Launch: [f]irefox [t]hunderbird
+bindsym $mod+o mode "$mode_launcher"
+
+mode "$mode_launcher" {
+    bindsym f exec firefox
+    bindsym t exec thunderbird
+
+    bindsym Escape mode "default"
+    bindsym Return mode "default"
+}
+
+
+
+

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 +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 +it to the position you want.

+

When holding the floating modifier, you can resize a floating window by +pressing the right mouse button on it and moving around while holding it. If +you hold the shift button as well, the resize will be proportional (the aspect +ratio will be preserved).

+

Syntax:

+
+
+
floating_modifier <Modifier>
+
+

Example:

+
+
+
floating_modifier Mod1
+
+
+
+

4.7. Constraining floating window size

+

The maximum and minimum dimensions of floating windows can be specified. If +either dimension of floating_maximum_size is specified as -1, that dimension +will be unconstrained with respect to its maximum value. If either dimension of +floating_maximum_size is undefined, or specified as 0, i3 will use a default +value to constrain the maximum size. floating_minimum_size is treated in a +manner analogous to floating_maximum_size.

+

Syntax:

+
+
+
floating_minimum_size <width> x <height>
+floating_maximum_size <width> x <height>
+
+

Example:

+
+
+
floating_minimum_size 75 x 50
+floating_maximum_size -1 x -1
+
+
+
+

4.8. Orientation for new workspaces

+

New workspaces get a reasonable default orientation: Wide-screen monitors +(anything wider than high) get horizontal orientation, rotated monitors +(anything higher than wide) get vertical orientation.

+

With the default_orientation configuration directive, you can override that +behavior.

+

Syntax:

+
+
+
default_orientation horizontal|vertical|auto
+
+

Example:

+
+
+
default_orientation vertical
+
+
+
+

4.9. Layout mode for new containers

+

This option determines in which mode new containers on workspace level will +start.

+

Syntax:

+
+
+
workspace_layout default|stacking|tabbed
+
+

Example:

+
+
+
workspace_layout tabbed
+
+
+
+

4.10. Window title alignment

+

This option determines the window title’s text alignment. +Default is left

+

Syntax:

+
+
+
title_align left|center|right
+
+
+
+

4.11. Default border style for new windows

+

This option determines which border style new windows will have. The default is +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.

+

Setting border style to pixel eliminates title bars. The border style normal allows you to +adjust edge border width while keeping your title bar.

+

Syntax:

+
+
+
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:

+
+
+
default_border pixel
+
+

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

+

Example:

+
+
+
# The same as default_border none
+default_border pixel 0
+
+# A 3 px border
+default_border pixel 3
+
+
+
+

4.12. Hiding borders adjacent to the screen edges

+

You can hide container borders adjacent to the screen edges using +hide_edge_borders. This is useful if you are using scrollbars, or do not want +to waste even two pixels in displayspace. The "smart" setting hides borders on +workspaces with only one window visible, but keeps them on workspaces with +multiple windows visible. Default is none.

+

Syntax:

+
+
+
hide_edge_borders none|vertical|horizontal|both|smart
+
+

Example:

+
+
+
hide_edge_borders vertical
+
+
+
+

4.13. Arbitrary commands for specific windows (for_window)

+

With the for_window directive, you can let i3 execute any command when it +encounters a specific window. This can be used to set windows to floating or to +change their border style, for example.

+

Syntax:

+
+
+
for_window <criteria> <command>
+
+

Examples:

+
+
+
# enable floating mode for all XTerm windows
+for_window [class="XTerm"] floating enable
+
+# Make all urxvts use a 1-pixel border:
+for_window [class="urxvt"] border pixel 1
+
+# A less useful, but rather funny example:
+# makes the window floating as soon as I change
+# directory to ~/work
+for_window [title="x200: ~/work"] floating enable
+
+

The valid criteria are the same as those for commands, see [command_criteria]. Only config +directives with a command equivalent can be executed at runtime, see [list_of_commands].

+
+
+

4.14. Don’t focus window upon opening

+

When a new window appears, it will be focused. The no_focus directive allows preventing +this from happening and must be used in combination with [command_criteria].

+

Note that this does not apply to all cases, e.g., when feeding data into a running application +causing it to request being focused. To configure the behavior in such cases, refer to +[focus_on_window_activation].

+

no_focus will also be ignored for the first window on a workspace as there shouldn’t be +a reason to not focus the window in this case. This allows for better usability in +combination with workspace_layout.

+

Syntax:

+
+
+
no_focus <criteria>
+
+

Example:

+
+
+
no_focus [window_role="pop-up"]
+
+
+
+

4.15. Variables

+

As you learned in the section about keyboard bindings, you will have +to configure lots of bindings containing modifier keys. If you want to save +yourself some typing and be able to change the modifier you use later, +variables can be handy.

+

Syntax:

+
+
+
set $<name> <value>
+
+

Example:

+
+
+
set $m Mod1
+bindsym $m+Shift+r restart
+
+

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).

+

Also see [xresources] to learn how to create variables based on resources +loaded from the X resource database.

+
+
+

4.16. X resources

+

[variables] can also be created using a value configured in the X resource +database. This is useful, for example, to avoid configuring color values within +the i3 configuration. Instead, the values can be configured, once, in the X +resource database to achieve an easily maintainable, consistent color theme +across many X applications.

+

Defining a resource will load this resource from the resource database and +assign its value to the specified variable. This is done verbatim and the value +must therefore be in the format that i3 uses. A fallback must be specified in +case the resource cannot be loaded from the database.

+

Syntax:

+
+
+
set_from_resource $<name> <resource_name> <fallback>
+
+

Example:

+
+
+
# The ~/.Xresources should contain a line such as
+#     *color0: #121212
+# and must be loaded properly, e.g., by using
+#     xrdb ~/.Xresources
+# This value is picked up on by other applications (e.g., the URxvt terminal
+# emulator) and can be used in i3 like this:
+set_from_resource $black i3wm.color0 #000000
+
+
+
+

4.17. Automatically putting clients on specific workspaces

+

To automatically make a specific window show up on a specific workspace, you +can use an assignment. You can match windows by using any criteria, +see [command_criteria]. The difference between assign and +for_window <criteria> move to workspace is that the former will only be +executed when the application maps the window (mapping means actually displaying +it on the screen) but the latter will be executed whenever a window changes its +properties to something that matches the specified criteria.

+

Thus, it is recommended that you match on window classes (and instances, when +appropriate) instead of window titles whenever possible because some +applications first create their window, and then worry about setting the correct +title. Firefox with Vimperator comes to mind. The window 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, you’d need to have to +match on Firefox in this case. +Another known issue is with Spotify, which doesn’t set the class hints when +mapping the window, meaning you’ll have to use a for_window rule to assign +Spotify to a specific workspace. +Finally, using assign [tiling] and assign [floating] is not supported.

+

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

Examples:

+
+
+
# Assign URxvt terminals to workspace 2
+assign [class="URxvt"] 2
+
+# Same thing, but more precise (exact match instead of substring)
+assign [class="^URxvt$"] 2
+
+# Same thing, but with a beautiful arrow :)
+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 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
+
+

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:

+

xprop:

+
+
+
WM_CLASS(STRING) = "irssi", "URxvt"
+
+

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 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 +workspace, but you don’t want to assign all instances of it permanently, you +can make use of i3’s startup-notification support (see [exec]) in your config +file in the following way:

+

Start iceweasel on workspace 3 (once):

+
+
+
# Start iceweasel on workspace 3, then switch back to workspace 1
+# (Being a command-line utility, i3-msg does not support startup notifications,
+#  hence the exec --no-startup-id.)
+# (Starting iceweasel with i3’s exec command is important in order to make i3
+#  create a startup notification context, without which the iceweasel window(s)
+#  cannot be matched onto the workspace on which the command was started.)
+exec --no-startup-id i3-msg 'workspace 3; exec iceweasel; workspace 1'
+
+
+
+

4.18. Automatically starting applications on i3 startup

+

By using the exec keyword outside a keybinding, you can configure +which commands will be performed by i3 on initial startup. exec +commands will not run when restarting i3, if you need a command to run +also when restarting i3 you should use the exec_always +keyword. These commands will be run in order.

+

See [command_chaining] for details on the special meaning of ; (semicolon) +and , (comma): they chain commands together in i3, so you need to use quoted +strings (as shown in [exec_quoting]) if they appear in your command.

+

Syntax:

+
+
+
exec [--no-startup-id] <command>
+exec_always [--no-startup-id] <command>
+
+

Examples:

+
+
+
exec chromium
+exec_always ~/my_script.sh
+
+# Execute the terminal emulator urxvt, which is not yet startup-notification aware.
+exec --no-startup-id urxvt
+
+

The flag --no-startup-id is explained in [exec].

+
+
+

4.19. Automatically putting workspaces on specific screens

+

If you assign clients to workspaces, it might be handy to put the +workspaces on specific screens. Also, the assignment of workspaces to screens +will determine which workspace i3 uses for a new screen when adding screens +or when starting (e.g., by default it will use 1 for the first screen, 2 for +the second screen and so on).

+

Syntax:

+
+
+
workspace <workspace> output <output1> [output2]…
+
+

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.)

+

You can specify multiple outputs. The first available will be used.

+

If you use named workspaces, they must be quoted:

+

Examples:

+
+
+
workspace 1 output LVDS1
+workspace 2 output primary
+workspace 5 output VGA1 LVDS1
+workspace "2: vim" output VGA1
+
+
+
+

4.20. Changing colors

+

You can change all colors which i3 uses to draw the window decorations.

+

Syntax:

+
+
+
<colorclass> <border> <background> <text> <indicator> <child_border>
+
+

Where colorclass can be one of:

+
+
+client.focused +
+
+

+ A client which currently has the focus. +

+
+
+client.focused_inactive +
+
+

+ A client which is the focused one of its container, but it does not have + the focus at the moment. +

+
+
+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. +

+
+
+client.background +
+
+

+ Background color which will be used to paint the background of the + client window on top of which the client will be rendered. Only clients + which do not cover the whole area of this window expose the color. Note + that this colorclass only takes a single color. +

+
+
+

Colors are in HTML hex format (#rrggbb), see the following example:

+

Examples (default colors):

+
+
+
# class                 border  backgr. text    indicator child_border
+client.focused          #4c7899 #285577 #ffffff #2e9ef4   #285577
+client.focused_inactive #333333 #5f676a #ffffff #484e50   #5f676a
+client.unfocused        #333333 #222222 #888888 #292d2e   #222222
+client.urgent           #2f343a #900000 #ffffff #900000   #900000
+client.placeholder      #000000 #0c0c0c #ffffff #000000   #0c0c0c
+
+client.background       #ffffff
+
+

Note that for the window decorations, the color around the child window is the +"child_border", and "border" color is only the two thin lines around the +titlebar.

+

The indicator color is used for indicating where a new window will be opened. +For horizontal split containers, the right border will be painted in indicator +color, for vertical split containers, the bottom border. This only applies to +single windows within a split container, which are otherwise indistinguishable +from single windows outside of a split container.

+
+
+

4.21. Interprocess communication

+

i3 uses Unix sockets to provide an IPC interface. This allows third-party +programs to get information from i3, such as the current workspaces +(to display a workspace bar), and to control i3.

+

The IPC socket is enabled by default and will be created in +/tmp/i3-%u.XXXXXX/ipc-socket.%p where %u is your UNIX username, %p is +the PID of i3 and XXXXXX is a string of random characters from the portable +filename character set (see mkdtemp(3)).

+

You can override the default path through the environment-variable I3SOCK or +by specifying the ipc-socket directive. This is discouraged, though, since i3 +does the right thing by default. If you decide to change it, it is strongly +recommended to set this to a location in your home directory so that no other +user can create that directory.

+

Examples:

+
+
+
ipc-socket ~/.i3/i3-ipc.sock
+
+

You can then use the i3-msg application to perform any command listed in +[list_of_commands].

+
+
+

4.22. Focus follows mouse

+

By default, window focus follows your mouse movements as the mouse crosses +window borders. However, if you have a setup where your mouse usually is in your +way (like a touchpad on your laptop which you do not want to disable +completely), you might want to disable focus follows mouse and control focus +only by using your keyboard. The mouse will still be useful inside the +currently active window (for example to click on links in your browser window).

+

Syntax:

+
+
+
focus_follows_mouse yes|no
+
+

Example:

+
+
+
focus_follows_mouse no
+
+
+
+

4.23. 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
+
+
+
+

4.24. Popups during fullscreen mode

+

When you are in fullscreen mode, some applications still open popup windows +(take Xpdf for example). This is because these applications may not be aware +that they are in fullscreen mode (they do not check the corresponding hint). +There are three things which are possible to do in this situation:

+
    +
  1. +

    +Display the popup if it belongs to the fullscreen application only. This is + the default and should be reasonable behavior for most users. +

    +
  2. +
  3. +

    +Just ignore the popup (don’t map it). This won’t interrupt you while you are + in fullscreen. However, some apps might react badly to this (deadlock until + you go out of fullscreen). +

    +
  4. +
  5. +

    +Leave fullscreen mode. +

    +
  6. +
+

Syntax:

+
+
+
popup_during_fullscreen smart|ignore|leave_fullscreen
+
+

Example:

+
+
+
popup_during_fullscreen smart
+
+
+
+

4.25. Focus wrapping

+

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 instead set focus_wrapping +to the value force.

+

Syntax:

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

Examples:

+
+
+
# Disable focus wrapping
+focus_wrapping no
+
+# Force focus wrapping
+focus_wrapping force
+
+
+
+

4.26. Forcing Xinerama

+

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 +reconfiguring your screens on the fly (they are read only once on startup and +that’s it).

+

For people who cannot modify their ~/.xsession to add the +--force-xinerama commandline parameter, a configuration option is provided:

+

Syntax:

+
+
+
force_xinerama yes|no
+
+

Example:

+
+
+
force_xinerama yes
+
+

Also note that your output names are not descriptive (like HDMI1) when using +Xinerama, instead they are counted up, starting at 0: xinerama-0, xinerama-1, …

+
+
+

4.27. Automatic back-and-forth when switching to the current workspace

+

This configuration directive enables automatic workspace back_and_forth (see +[back_and_forth]) when switching to the workspace that is currently focused.

+

For instance: Assume you are on workspace "1: www" and switch to "2: IM" using +mod+2 because somebody sent you a message. You don’t need to remember where you +came from now, you can just press $mod+2 again to switch back to "1: www".

+

Syntax:

+
+
+
workspace_auto_back_and_forth yes|no
+
+

Example:

+
+
+
workspace_auto_back_and_forth yes
+
+
+
+

4.28. Delaying urgency hint reset on workspace change

+

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 reset to client.focused. This +may make it unnecessarily hard to tell which window originally raised the +event.

+

In order to prevent this, you can tell i3 to delay resetting the urgency state +by a certain time using the force_display_urgency_hint directive. Setting the +value to 0 disables this feature.

+

The default is 500ms.

+

Syntax:

+
+
+
force_display_urgency_hint <timeout> ms
+
+

Example:

+
+
+
force_display_urgency_hint 500 ms
+
+
+
+

4.29. Focus on window activation

+

If a window is activated, e.g., via google-chrome www.google.com, it may request +to take focus. Since this may not preferable, different reactions can be configured.

+

Note that this may not affect windows that are being opened. To prevent new windows +from being focused, see [no_focus].

+

Syntax:

+
+
+
focus_on_window_activation smart|urgent|focus|none
+
+

The different modes will act as follows:

+
+
+smart +
+
+

+ This is the default behavior. If the window requesting focus is on an active + workspace, it will receive the focus. Otherwise, the urgency hint will be set. +

+
+
+urgent +
+
+

+ The window will always be marked urgent, but the focus will not be stolen. +

+
+
+focus +
+
+

+ The window will always be focused and not be marked urgent. +

+
+
+none +
+
+

+ The window will neither be focused, nor be marked urgent. +

+
+
+
+
+

4.30. Drawing marks on window decoration

+

If activated, marks (see [vim_like_marks]) on windows are drawn in their window +decoration. However, any mark starting with an underscore in its name (_) will +not be drawn even if this option is activated.

+

The default for this option is yes.

+

Syntax:

+
+
+
show_marks yes|no
+
+

Example:

+
+
+
show_marks yes
+
+
+
+

4.31. Line continuation

+

Config files support line continuation, meaning when you end a line in a +backslash character (\), the line-break will be ignored by the parser. This +feature can be used to create more readable configuration files. +Commented lines are not continued.

+

Examples:

+
+
+
bindsym Mod1+f \
+fullscreen toggle
+
+# this line is not continued \
+bindsym Mod1+F fullscreen toggle
+
+
+
+
+
+

5. Configuring i3bar

+
+

The bar at the bottom of your monitor is drawn by a separate process called +i3bar. Having this part of "the i3 user interface" in a separate process has +several advantages:

+
    +
  1. +

    +It is a modular approach. If you don’t need a workspace bar at all, or if + you prefer a different one (dzen2, xmobar, maybe even gnome-panel?), you can + just remove the i3bar configuration and start your favorite bar instead. +

    +
  2. +
  3. +

    +It follows the UNIX philosophy of "Make each program do one thing well". + While i3 manages your windows well, i3bar is good at displaying a bar on + each monitor (unless you configure it otherwise). +

    +
  4. +
  5. +

    +It leads to two separate, clean codebases. If you want to understand i3, you + don’t need to bother with the details of i3bar and vice versa. +

    +
  6. +
+

That said, i3bar is configured in the same configuration file as i3. This is +because it is tightly coupled with i3 (in contrary to i3lock or i3status which +are useful for people using other window managers). Therefore, it makes no +sense to use a different configuration place when we already have a good +configuration infrastructure in place.

+

Configuring your workspace bar starts with opening a bar block. You can have +multiple bar blocks to use different settings for different outputs (monitors):

+

Example:

+
+
+
bar {
+    status_command i3status
+}
+
+
+

5.1. i3bar command

+

By default i3 will just pass i3bar and let your shell handle the execution, +searching your $PATH for a correct version. +If you have a different i3bar somewhere or the binary is not in your $PATH you can +tell i3 what to execute.

+

The specified command will be passed to sh -c, so you can use globbing and +have to have correct quoting etc.

+

Syntax:

+
+
+
i3bar_command <command>
+
+

Example:

+
+
+
bar {
+    i3bar_command /home/user/bin/i3bar
+}
+
+
+
+

5.2. Statusline command

+

i3bar can run a program and display every line of its stdout output on the +right hand side of the bar. This is useful to display system information like +your current IP address, battery status or date/time.

+

The specified command will be passed to sh -c, so you can use globbing and +have to have correct quoting etc. Note that for signal handling, depending on +your shell (users of dash(1) are known to be affected), you have to use the +shell’s exec command so that signals are passed to your program, not to the +shell.

+

Syntax:

+
+
+
status_command <command>
+
+

Example:

+
+
+
bar {
+    status_command i3status --config ~/.i3status.conf
+
+    # For dash(1) users who want signal handling to work:
+    status_command exec ~/.bin/my_status_command
+}
+
+
+
+

5.3. Display mode

+

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.

+

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|invisible
+hidden_state hide|show
+modifier <Modifier>|none
+
+

Example:

+
+
+
bar {
+    mode hide
+    hidden_state hide
+    modifier Mod1
+}
+
+

Available modifiers are Mod1-Mod5, Shift, Control (see xmodmap(1)). You can +also use "none" if you don’t want any modifier to trigger this behavior.

+
+
+

5.4. Mouse button commands

+

Specifies a command to run when a button was pressed on i3bar to override the +default behavior. This is useful, e.g., for disabling the scroll wheel action +or running scripts that implement custom behavior for these buttons.

+

A button is always named button<n>, where 1 to 5 are default buttons as follows and higher +numbers can be special buttons on devices offering more buttons:

+
+
+button1 +
+
+

+ Left mouse button. +

+
+
+button2 +
+
+

+ Middle mouse button. +

+
+
+button3 +
+
+

+ Right mouse button. +

+
+
+button4 +
+
+

+ Scroll wheel up. +

+
+
+button5 +
+
+

+ Scroll wheel down. +

+
+
+

Please note that the old wheel_up_cmd and wheel_down_cmd commands are deprecated +and will be removed in a future release. We strongly recommend using the more general +bindsym with button4 and button5 instead.

+

Syntax:

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

Example:

+
+
+
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
+}
+
+
+
+

5.5. 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
+}
+
+
+
+

5.6. Position

+

This option determines in which edge of the screen i3bar should show up.

+

The default is bottom.

+

Syntax:

+
+
+
position top|bottom
+
+

Example:

+
+
+
bar {
+    position top
+}
+
+
+
+

5.7. Output(s)

+

You can restrict i3bar to one or more outputs (monitors). The default is to +handle all outputs. Restricting the outputs is useful for using different +options for different outputs by using multiple bar blocks.

+

To make a particular i3bar instance handle multiple outputs, specify the output +directive multiple times.

+

Syntax:

+
+
+
output primary|<output>
+
+

Example:

+
+
+
# big monitor: everything
+bar {
+    # The display is connected either via HDMI or via DisplayPort
+    output HDMI2
+    output DP2
+    status_command i3status
+}
+
+# laptop monitor: bright colors and i3status with less modules.
+bar {
+    output LVDS1
+    status_command i3status --config ~/.i3status-small.conf
+    colors {
+        background #000000
+        statusline #ffffff
+    }
+}
+
+# show bar on the primary monitor and on HDMI2
+bar {
+    output primary
+    output HDMI2
+    status_command i3status
+}
+
+

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

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

5.8. Tray output

+

i3bar by default provides a system tray area where programs such as +NetworkManager, VLC, Pidgin, etc. can place little icons.

+

You can configure on which output (monitor) the icons should be displayed or +you can turn off the functionality entirely.

+

You can use multiple tray_output directives in your config to specify a list +of outputs on which you want the tray to appear. The first available output in +that list as defined by the order of the directives will be used for the tray +output.

+

Syntax:

+
+
+
tray_output none|primary|<output>
+
+

Example:

+
+
+
# disable system tray
+bar {
+    tray_output none
+}
+
+# show tray icons on the primary monitor
+bar {
+    tray_output primary
+}
+
+# show tray icons on the big monitor
+bar {
+    tray_output HDMI2
+}
+
+

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

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

Note that when you use multiple bar configuration blocks, either specify +tray_output primary in all of them or explicitly specify tray_output none +in bars which should not display the tray, otherwise the different instances +might race each other in trying to display tray icons.

+
+
+

5.9. Tray padding

+

The tray is shown on the right-hand side of the bar. By default, a padding of 2 +pixels is used for the upper, lower and right-hand side of the tray area and +between the individual icons.

+

Syntax:

+
+
+
tray_padding <px> [px]
+
+

Example:

+
+
+
# Obey Fitts's law
+tray_padding 0
+
+
+
+

5.10. Font

+

Specifies the font to be used in the bar. See [fonts].

+

Syntax:

+
+
+
font <font>
+
+

Example:

+
+
+
bar {
+    font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+    font pango:DejaVu Sans Mono 10
+}
+
+
+
+

5.11. Custom separator symbol

+

Specifies a custom symbol to be used for the separator as opposed to the vertical, +one pixel thick separator.

+

Syntax:

+
+
+
separator_symbol <symbol>
+
+

Example:

+
+
+
bar {
+    separator_symbol ":|:"
+}
+
+
+
+

5.12. Workspace buttons

+

Specifies whether workspace buttons should be shown or not. This is useful if +you want to display a statusline-only bar containing additional information.

+

The default is to show workspace buttons.

+

Syntax:

+
+
+
workspace_buttons yes|no
+
+

Example:

+
+
+
bar {
+    workspace_buttons no
+}
+
+
+
+

5.13. Strip workspace numbers/name

+

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", …

+

When strip_workspace_name is set to yes, any workspace that has a name of +the form "[n][:][NAME]" will display only the number.

+

The default is to display the full name within the workspace button. Be aware +that the colon in the workspace name is optional, so [n][NAME] will also +have the the workspace name and number stripped correctly.

+

Syntax:

+
+
+
strip_workspace_numbers yes|no
+strip_workspace_name yes|no
+
+

Example:

+
+
+
bar {
+    strip_workspace_numbers yes
+}
+
+
+
+

5.14. 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. See [binding_modes] to learn what +modes are and how to use them.

+

The default is to show the mode indicator.

+

Syntax:

+
+
+
binding_mode_indicator yes|no
+
+

Example:

+
+
+
bar {
+    binding_mode_indicator no
+}
+
+
+
+

5.15. Colors

+

As with i3, colors are in HTML hex format (#rrggbb). The following colors can +be configured at the moment:

+
+
+background +
+
+

+ Background color of the bar. +

+
+
+statusline +
+
+

+ Text color to be used for the statusline. +

+
+
+separator +
+
+

+ Text color to be used for the separator. +

+
+
+focused_background +
+
+

+ Background color of the bar on the currently focused monitor output. If + not used, the color will be taken from background. +

+
+
+focused_statusline +
+
+

+ Text color to be used for the statusline on the currently focused + monitor output. If not used, the color will be taken from statusline. +

+
+
+focused_separator +
+
+

+ Text color to be used for the separator on the currently focused + monitor output. If not used, the color will be taken from separator. +

+
+
+focused_workspace +
+
+

+ Border, background and text color for a workspace button when the workspace + has focus. +

+
+
+active_workspace +
+
+

+ Border, background and text color for a workspace button when the workspace + is active (visible) on some output, but the focus is on another one. + You can only tell this apart from the focused workspace when you are + using multiple monitors. +

+
+
+inactive_workspace +
+
+

+ Border, background and text color for a workspace button when the workspace + does not have focus and is not active (visible) on any output. This + will be the case for most workspaces. +

+
+
+urgent_workspace +
+
+

+ Border, background and text color for a workspace button when the workspace + contains a window with the urgency hint set. +

+
+
+binding_mode +
+
+

+ Border, background and text color for the binding mode indicator. If not used, + the colors will be taken from urgent_workspace. +

+
+
+

Syntax:

+
+
+
colors {
+    background <color>
+    statusline <color>
+    separator <color>
+
+    <colorclass> <border> <background> <text>
+}
+
+

Example (default colors):

+
+
+
bar {
+    colors {
+        background #000000
+        statusline #ffffff
+        separator #666666
+
+        focused_workspace  #4c7899 #285577 #ffffff
+        active_workspace   #333333 #5f676a #ffffff
+        inactive_workspace #333333 #222222 #888888
+        urgent_workspace   #2f343a #900000 #ffffff
+        binding_mode       #2f343a #900000 #ffffff
+    }
+}
+
+
+
+

5.16. Transparency

+

i3bar can support transparency by passing the --transparency flag in the +configuration:

+

Syntax:

+
+
+
bar {
+    i3bar_command i3bar --transparency
+}
+
+

In the i3bar color configuration and i3bar status block color attribute you can +then use colors in the RGBA format, i.e. the last two (hexadecimal) digits +specify the opacity. For example, #00000000 will be completely transparent, +while #000000FF will be a fully opaque black (the same as #000000).

+

Please note that due to the way the tray specification works, enabling this +flag will cause all tray icons to have a transparent background.

+
+
+
+
+

6. List of commands

+
+

Commands are what you bind to specific keypresses. You can also issue commands +at runtime without pressing a key by using the IPC interface. An easy way to +do this is to use the i3-msg utility:

+

Example:

+
+
+
# execute this on your shell to make the current container borderless
+i3-msg border none
+
+

Commands can be chained by using ; (a semicolon). So, to move a window to a +specific workspace and immediately switch to that workspace, you can configure +the following keybinding:

+

Example:

+
+
+
bindsym $mod+x move container to workspace 3; workspace 3
+
+

Furthermore, you can change the scope of a command - that is, which containers +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
+
+# move all floating windows to the scratchpad
+bindsym $mod+x [floating] move scratchpad
+
+

The criteria which are currently implemented are:

+
+
+class +
+
+

+ Compares the window class (the second part of WM_CLASS). Use the + special value __focused__ to match all windows having the same window + class as the currently focused window. +

+
+
+instance +
+
+

+ Compares the window instance (the first part of WM_CLASS). Use the + special value __focused__ to match all windows having the same window + instance as the currently focused window. +

+
+
+window_role +
+
+

+ Compares the window role (WM_WINDOW_ROLE). Use the special value + __focused__ to match all windows having the same window role as the + currently focused window. +

+
+
+window_type +
+
+

+ Compare the window type (_NET_WM_WINDOW_TYPE). Possible values are + normal, dialog, utility, toolbar, splash, menu, dropdown_menu, + popup_menu, tooltip and notification. +

+
+
+id +
+
+

+ Compares the X11 window ID, which you can get via xwininfo for example. +

+
+
+title +
+
+

+ Compares the X11 window title (_NET_WM_NAME or WM_NAME as fallback). + Use the special value __focused__ to match all windows having the + same window title as the currently focused window. +

+
+
+urgent +
+
+

+ Compares the urgent state of the window. Can be "latest" or "oldest". + Matches the latest or oldest urgent window, respectively. + (The following aliases are also available: newest, last, recent, first) +

+
+
+workspace +
+
+

+ Compares the workspace name of the workspace the window belongs to. Use + the special value __focused__ to match all windows in the currently + focused workspace. +

+
+
+con_mark +
+
+

+ Compares the marks set for this container, see [vim_like_marks]. A + match is made if any of the container’s marks matches the specified + mark. +

+
+
+con_id +
+
+

+ Compares the i3-internal container ID, which you can get via the IPC + interface. Handy for scripting. Use the special value __focused__ + to match only the currently focused window. +

+
+
+floating +
+
+

+ Only matches floating windows. This criterion requires no value. +

+
+
+tiling +
+
+

+ Only matches tiling windows. This criterion requires no value. +

+
+
+

The criteria class, instance, role, title, workspace and mark are +actually regular expressions (PCRE). See pcresyntax(3) or perldoc perlre for +information on how to use them.

+

Note that config directives listed under [configuring] cannot be changed at runtime +unless they happen to have a command equivalent.

+
+

6.1. Executing applications (exec)

+

What good is a window manager if you can’t actually start any applications? +The exec command starts an application by passing the command you specify to a +shell. This implies that you can use globbing (wildcards) and programs will be +searched in your $PATH.

+

See [command_chaining] for details on the special meaning of ; (semicolon) +and , (comma): they chain commands together in i3, so you need to use quoted +strings (as shown in [exec_quoting]) if they appear in your command.

+

Syntax:

+
+
+
exec [--no-startup-id] <command>
+
+

Example:

+
+
+
# Start the GIMP
+bindsym $mod+g exec gimp
+
+# Start the terminal emulator urxvt which is not yet startup-notification-aware
+bindsym $mod+Return exec --no-startup-id urxvt
+
+

The --no-startup-id parameter disables startup-notification support for this +particular exec command. With startup-notification, i3 can make sure that a +window appears on the workspace on which you used the exec command. Also, it +will change the X11 cursor to watch (a clock) while the application is +launching. So, if an application is not startup-notification aware (most GTK +and Qt using applications seem to be, though), you will end up with a watch +cursor for 60 seconds.

+

If the command to be executed contains a ; (semicolon) and/or a , (comma), +the entire command must be quoted. For example, to have a keybinding for the +shell command notify-send Hello, i3, you would add an entry to your +configuration file like this:

+

Example:

+
+
+
# Execute a command with a comma in it
+bindsym $mod+p exec "notify-send Hello, i3"
+
+

If however a command with a comma and/or semicolon itself requires quotes, you +must escape the internal quotation marks with double backslashes, like this:

+

Example:

+
+
+
# Execute a command with a comma, semicolon and internal quotes
+bindsym $mod+p exec "notify-send \\"Hello, i3; from $USER\\""
+
+
+
+

6.2. Splitting containers

+

The split command makes the current window a split container. Split containers +can contain multiple windows. Depending on the layout of the split container, +new windows get placed to the right of the current one (splith) or new windows +get placed below the current one (splitv).

+

If you apply this command to a split container with the same orientation, +nothing will happen. If you use a different orientation, the split container’s +orientation will be changed (if it does not have more than one window). +The toggle option will toggle the orientation of the split container if it +contains a single window. Otherwise it makes the current window a split +container with opposite orientation compared to the parent container. +Use layout toggle split to change the layout of any split container from +splitv to splith or vice-versa. You can also define a custom sequence of layouts +to cycle through with layout toggle, see [manipulating_layout].

+

Syntax:

+
+
+
split vertical|horizontal|toggle
+
+

Example:

+
+
+
bindsym $mod+v split vertical
+bindsym $mod+h split horizontal
+bindsym $mod+t split toggle
+
+
+
+

6.3. Manipulating layout

+

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.

+

Specify up to four layouts after layout toggle to cycle through them. Every +time the command is executed, the layout specified after the currently active +one will be applied. If the currently active layout is not in the list, the +first layout in the list will be activated.

+

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:

+
+
+
layout default|tabbed|stacking|splitv|splith
+layout toggle [split|all]
+layout toggle [split|tabbed|stacking|splitv|splith] [split|tabbed|stacking|splitv|splith]…
+
+

Examples:

+
+
+
bindsym $mod+s layout stacking
+bindsym $mod+l layout toggle split
+bindsym $mod+w layout tabbed
+
+# Toggle between stacking/tabbed/split:
+bindsym $mod+x layout toggle
+
+# Toggle between stacking/tabbed/splith/splitv:
+bindsym $mod+x layout toggle all
+
+# Toggle between stacking/tabbed/splith:
+bindsym $mod+x layout toggle stacking tabbed splith
+
+# Toggle between splitv/tabbed
+bindsym $mod+x layout toggle splitv tabbed
+
+# Toggle between last split layout/tabbed/stacking
+bindsym $mod+x layout toggle split tabbed stacking
+
+# Toggle fullscreen
+bindsym $mod+f fullscreen toggle
+
+# Toggle floating/tiling
+bindsym $mod+t floating toggle
+
+
+
+

6.4. Focusing containers

+

To change focus, you can use the focus command. The following options are +available:

+
+
+<criteria> +
+
+

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

+
+
+left|right|up|down +
+
+

+ Sets focus to the nearest container in the given direction. +

+
+
+parent +
+
+

+ Sets focus to the parent container of the current container. +

+
+
+child +
+
+

+ The opposite of focus parent, sets the focus to the last focused + child container. +

+
+
+floating +
+
+

+ Sets focus to the last focused floating container. +

+
+
+tiling +
+
+

+ Sets focus to the last focused tiling container. +

+
+
+mode_toggle +
+
+

+ Toggles between floating/tiling containers. +

+
+
+output +
+
+

+ Followed by a direction or an output name, this will focus the + corresponding output. +

+
+
+

Syntax:

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

Examples:

+
+
+
# 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
+bindsym $mod+semicolon focus right
+
+# Focus parent container
+bindsym $mod+u focus parent
+
+# Focus last floating/tiling container
+bindsym $mod+g focus mode_toggle
+
+# Focus the output right to the current one
+bindsym $mod+x focus output right
+
+# Focus the big output
+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:

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

6.5. Moving containers

+

Use the move command to move a container.

+

Syntax:

+
+
+
# 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 to the specified pos_x and pos_y
+# coordinates on the screen.
+move position <pos_x> [px] <pos_y> [px]
+
+# Moves the container to the center of the screen.
+# If 'absolute' is used, it is moved to the center of
+# all outputs.
+move [absolute] position center
+
+# Moves the container to the current position of the
+# mouse cursor. Only affects floating containers.
+move position mouse
+
+

Examples:

+
+
+
# 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
+# 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
+
+
+
+

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 +containers that have a parent-child relationship to one another does not work.

+

Syntax:

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

Examples:

+
+
+
# Swaps the focused container with the container marked »swapee«.
+swap container with mark swapee
+
+# Swaps container marked »A« and »B«
+[con_mark="^A$"] swap container with mark B
+
+
+
+

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 +window.

+

Note that while any window can be made sticky through this command, it will +only take effect if the window is floating.

+

Syntax:

+
+
+
sticky enable|disable|toggle
+
+

Examples:

+
+
+
# make a terminal sticky that was started as a notepad
+for_window [instance=notepad] sticky enable
+
+
+
+

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 [workspace_auto_back_and_forth] for this +specific call only.

+

To move containers to specific workspaces, use move container to workspace.

+

You can also switch to the next and previous workspace with the commands +workspace next and workspace prev, which is handy, for example, if you have +workspace 1, 3, 4 and 9 and you want to cycle through them with a single key +combination. To restrict those to the current output, use workspace +next_on_output and workspace prev_on_output. Similarly, you can use move +container to workspace next, move container to workspace prev to move a +container to the next/previous workspace and move container to workspace current +(the last one makes sense only when used with criteria).

+

workspace next cycles through either numbered or named workspaces. But when it +reaches the last numbered/named workspace, it looks for named workspaces after +exhausting numbered ones and looks for numbered ones after exhausting named ones.

+

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

+

Workspace names are parsed as +Pango markup +by i3bar.

+

To switch back to the previously focused workspace, use workspace +back_and_forth; likewise, you can move containers to the previously focused +workspace using move container to workspace back_and_forth.

+

Syntax:

+
+
+
workspace next|prev|next_on_output|prev_on_output
+workspace back_and_forth
+workspace [--no-auto-back-and-forth] <name>
+workspace [--no-auto-back-and-forth] number <name>
+
+move [--no-auto-back-and-forth] [window|container] [to] workspace <name>
+move [--no-auto-back-and-forth] [window|container] [to] workspace number <name>
+move [window|container] [to] workspace prev|next|current
+
+

Examples:

+
+
+
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
+bindsym $mod+Shift+2 move container to workspace 2
+...
+
+# switch between the current and the previously focused one
+bindsym $mod+b workspace back_and_forth
+bindsym $mod+Shift+b move container to workspace back_and_forth
+
+# move the whole workspace to the next output
+bindsym $mod+x move workspace to output right
+
+# move firefox to current workspace
+bindsym $mod+F1 [class="Firefox"] move workspace current
+
+
+

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:

+
+
+
bindsym $mod+1 workspace mail
+...
+
+

If you want the workspace to have a number and a name, just prefix the +number, like this:

+

Example:

+
+
+
bindsym $mod+1 workspace 1: mail
+bindsym $mod+2 workspace 2: www
+...
+
+

Note that the workspace will really be named "1: mail". i3 treats workspace +names beginning with a number in a slightly special way. Normally, named +workspaces are ordered the way they appeared. When they start with a number, i3 +will order them numerically. Also, you will be able to use workspace number 1 +to switch to the workspace which begins with number 1, regardless of which name +it has. This is useful in case you are changing the workspace’s name +dynamically. To combine both commands you can use workspace number 1: mail to +specify a default name if there’s currently no workspace starting with a "1".

+
+
+

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 +the currently focused workspace. This is handy if you want to use the +rename command with i3-input.

+

Syntax:

+
+
+
rename workspace <old_name> to <new_name>
+rename workspace to <new_name>
+
+

Examples:

+
+
+
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: '
+
+

If you want to rename workspaces on demand while keeping the navigation stable, +you can use a setup like this:

+

Example:

+
+
+
bindsym $mod+1 workspace number "1: www"
+bindsym $mod+2 workspace number "2: mail"
+...
+
+

If a workspace does not exist, the command workspace number "1: mail" will +create workspace "1: mail".

+

If a workspace with number 1 does already exist, the command will switch to this +workspace and ignore the text part. So even when the workspace has been renamed +to "1: web", the above command will still switch to it.

+
+
+
+

6.9. Moving workspaces to a different screen

+

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

+
+
+

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:

+

Syntax:

+
+
+
move container to output left|right|down|up|current|primary|<output>
+move workspace to output left|right|down|up|current|primary|<output>
+
+

Examples:

+
+
+
# Move the current workspace to the next output
+# (effectively toggles when you only have two outputs)
+bindsym $mod+x move workspace to output right
+
+# Put this window on the presentation output.
+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:

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

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:

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

Example:

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

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] <width> [px | ppt]
+resize set height <height> [px | ppt]
+resize set [width] <width> [px | ppt] [height] <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 space +from all the other containers. The optional pixel argument specifies by how many +pixels a container should be grown or shrunk (the default is 10 pixels). The +optional ppt argument means "percentage points", and if specified it indicates +that a tiling container should be grown or shrunk by that many points, instead +of by the px value.

+

Note about resize set: a value of 0 for <width> or <height> means "do not +resize in this direction".

+

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 +context.

+

Example:

+
+
+
for_window [class="urxvt"] resize set 640 480
+
+
+
+

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 +important goal. Instead of figuring out how to navigate to your mail client, +it would be more convenient to have a shortcut. You can use the focus command +with criteria for that.

+

Syntax:

+
+
+
[class="class"] focus
+[title="title"] focus
+
+

Examples:

+
+
+
# Get me to the next open VIM instance
+bindsym $mod+a [class="urxvt" title="VIM"] focus
+
+
+
+

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 +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 +for this purpose: It lets you input a command and sends the command to i3. It +can also prefix this command and display a custom prompt for the input dialog.

+

The additional --toggle option will remove the mark if the window already has +this mark or add it otherwise. Note that you may need to use this in +combination with --add (see below) as any other marks will otherwise be +removed.

+

The --replace flag causes i3 to remove any existing marks, which is also the +default behavior. You can use the --add flag to put more than one mark on a +window.

+

Refer to [show_marks] if you don’t want marks to be shown in the window decoration.

+

Syntax:

+
+
+
mark [--add|--replace] [--toggle] <identifier>
+[con_mark="identifier"] focus
+unmark <identifier>
+
+

You can use i3-input to prompt for a mark name, then use the mark +and focus commands to create and jump to custom marks:

+

Examples:

+
+
+
# read 1 character and mark the current window with this character
+bindsym $mod+m exec i3-input -F 'mark %s' -l 1 -P 'Mark: '
+
+# read 1 character and go to the window with the character
+bindsym $mod+g exec i3-input -F '[con_mark="%s"] focus' -l 1 -P 'Goto: '
+
+

Alternatively, if you do not want to mess with i3-input, you could create +separate bindings for a specific set of labels and then only use those labels:

+

Example (in a terminal):

+
+
+
# marks the focused container
+mark irssi
+
+# focus the container with the mark "irssi"
+'[con_mark="irssi"] focus'
+
+# remove the mark "irssi" from whichever container has it
+unmark irssi
+
+# remove all marks on all firefox windows
+[class="(?i)firefox"] unmark
+
+
+
+

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 +Pango markup +and the following placeholders which will be replaced:

+
+
+%title +
+
+

+ For normal windows, this is the X11 window title (_NET_WM_NAME or WM_NAME + as fallback). When used on containers without a window (e.g., a split + container inside a tabbed/stacked layout), this will be the tree + representation of the container (e.g., "H[xterm xterm]"). +

+
+
+%class +
+
+

+ The X11 window class (second part of WM_CLASS). This corresponds to the + class criterion, see [command_criteria]. +

+
+
+%instance +
+
+

+ The X11 window instance (first part of WM_CLASS). This corresponds to the + instance criterion, see [command_criteria]. +

+
+
+

Using the [for_window] directive, you can set the title format for any window +based on [command_criteria].

+

Syntax:

+
+
+
title_format <format>
+
+

Examples:

+
+
+
# give the focused window a prefix
+bindsym $mod+p title_format "Important | %title"
+
+# print all window titles bold
+for_window [class=".*"] title_format "<b>%title</b>"
+
+# print window titles of firefox windows red
+for_window [class="(?i)firefox"] title_format "<span foreground='red'>%title</span>"
+
+
+
+

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.

+

There is also border toggle which will toggle the different border styles. The +optional pixel argument can be used to specify the border width when switching +to the normal and pixel styles.

+

Note that "pixel" refers to logical pixel. On HiDPI displays, a logical pixel +may be represented by multiple physical pixels, so pixel 1 might not +necessarily translate into a single pixel row wide border.

+

Syntax:

+
+
+
border normal|pixel|toggle [<n>]
+border none
+
+# legacy syntax, equivalent to "border pixel 1"
+border 1pixel
+
+

Examples:

+
+
+
# use window title, but no border
+bindsym $mod+t border normal 0
+# use no window title and a thick border
+bindsym $mod+y border pixel 3
+# use neither window title nor border
+bindsym $mod+u border none
+
+
+
+

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 +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))
+
+
+
+

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 +likely useful in combination with the above-described [shmlog] command.

+

Syntax:

+
+
+
debuglog on|off|toggle
+
+

Examples:

+
+
+
# Enable/disable logging
+bindsym $mod+x debuglog toggle
+
+
+
+

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 +your X session. To exit i3 properly, you can use the exit command, +however you don’t need to (simply killing your X session is fine as well).

+

Examples:

+
+
+
bindsym $mod+Shift+r restart
+bindsym $mod+Shift+w reload
+bindsym $mod+Shift+e exit
+
+
+
+

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. +Instead, when using scratchpad show, the window will be shown again, as a +floating window, centered on your current workspace (using scratchpad show on +a visible scratchpad window will make it hidden again, so you can have a +keybinding to toggle). Note that this is just a normal floating window, so if +you want to "remove it from scratchpad", you can simple make it tiling again +(floating toggle).

+

As the name indicates, this is useful for having a window with your favorite +editor always at hand. However, you can also use this for other permanently +running applications which you don’t want to see all the time: Your music +player, alsamixer, maybe even your mail client…?

+

Syntax:

+
+
+
move scratchpad
+
+scratchpad show
+
+

Examples:

+
+
+
# Make the currently focused window a scratchpad
+bindsym $mod+Shift+minus move scratchpad
+
+# Show the first scratchpad window
+bindsym $mod+minus scratchpad show
+
+# Show the sup-mail scratchpad window, if any.
+bindsym mod4+s [title="^Sup ::"] scratchpad show
+
+
+
+

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.

+

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
+
+
+
+

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 +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
+
+
+
+
+
+

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 +handle multiple monitors.

+

When you have only one monitor, things are simple. You usually start with +workspace 1 on your monitor and open new ones as you need them.

+

When you have more than one monitor, each monitor will get an initial +workspace. The first monitor gets 1, the second gets 2 and a possible third +would get 3. When you switch to a workspace on a different monitor, i3 will +switch to that monitor and then switch to the workspace. This way, you don’t +need shortcuts to switch to a specific monitor, and you don’t need to remember +where you put which workspace. New workspaces will be opened on the currently +active monitor. It is not possible to have a monitor without a workspace.

+

The idea of making workspaces global is based on the observation that most +users have a very limited set of workspaces on their additional monitors. +They are often used for a specific task (browser, shell) or for monitoring +several things (mail, IRC, syslog, …). Thus, using one workspace on one monitor +and "the rest" on the other monitors often makes sense. However, as you can +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).

+
+

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. +Just run "xrandr" and you will get an output like the following:

+
+
+
$ xrandr
+Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192
+VGA1 disconnected (normal left inverted right x axis y axis)
+LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm
+   1280x800       60.0*+   50.0
+   1024x768       85.0     75.0     70.1     60.0
+   832x624        74.6
+   800x600        85.1     72.2     75.0     60.3     56.2
+   640x480        85.0     72.8     75.0     59.9
+   720x400        85.0
+   640x400        85.1
+   640x350        85.1
+
+

Several things are important here: You can see that LVDS1 is connected (of +course, it is the internal flat panel) but VGA1 is not. If you have a monitor +connected to one of the ports but xrandr still says "disconnected", you should +check your cable, monitor or graphics driver.

+

The maximum resolution you can see at the end of the first line is the maximum +combined resolution of your monitors. By default, it is usually too low and has +to be increased by editing /etc/X11/xorg.conf.

+

So, say you connected VGA1 and want to use it as an additional screen:

+
+
+
xrandr --output VGA1 --auto --left-of LVDS1
+
+

This command makes xrandr try to find the native resolution of the device +connected to VGA1 and configures it to the left of your internal flat panel. +When running "xrandr" again, the output looks like this:

+
+
+
$ xrandr
+Screen 0: minimum 320 x 200, current 2560 x 1024, maximum 8192 x 8192
+VGA1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm
+   1280x1024      60.0*+   75.0
+   1280x960       60.0
+   1152x864       75.0
+   1024x768       75.1     70.1     60.0
+   832x624        74.6
+   800x600        72.2     75.0     60.3     56.2
+   640x480        72.8     75.0     66.7     60.0
+   720x400        70.1
+LVDS1 connected 1280x800+1280+0 (normal left inverted right x axis y axis) 261mm x 163mm
+   1280x800       60.0*+   50.0
+   1024x768       85.0     75.0     70.1     60.0
+   832x624        74.6
+   800x600        85.1     72.2     75.0     60.3     56.2
+   640x480        85.0     72.8     75.0     59.9
+   720x400        85.0
+   640x400        85.1
+   640x350        85.1
+
+

Please note that i3 uses exactly the same API as xrandr does, so it will see +only what you can see in xrandr.

+

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

+
+
+

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:

+
    +
  1. +

    +You can specify which workspace should be put on which screen. This + allows you to have a different set of workspaces when starting than just + 1 for the first monitor, 2 for the second and so on. See + [workspace_screen]. +

    +
  2. +
  3. +

    +If you want some applications to generally open on the bigger screen + (MPlayer, Firefox, …), you can assign them to a specific workspace, see + [assign_workspace]. +

    +
  4. +
  5. +

    +If you have many workspaces on many monitors, it might get hard to keep + track of which window you put where. Thus, you can use vim-like marks to + quickly switch between windows. See [vim_like_marks]. +

    +
  6. +
  7. +

    +For information on how to move existing workspaces between monitors, + see [move_to_outputs]. +

    +
  8. +
+
+
+
+
+

8. i3 and the rest of your software world

+
+
+

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.

+

If you don’t already have your favorite way of generating such a status line +(self-written scripts, conky, …), then i3status is the recommended tool for +this task. It was written in C with the goal of using as few syscalls as +possible to reduce the time your CPU is woken up from sleep states. Because +i3status only spits out text, you need to combine it with some other tool, like +i3bar. See [status_command] for how to display i3status in i3bar.

+

Regardless of which application you use to display the status line, you +want to make sure that it registers as a dock window using EWMH hints. i3 will +position the window either at the top or at the bottom of the screen, depending +on which hint the application sets. With i3bar, you can configure its position, +see [i3bar_position].

+
+
+

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.

+
+

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:

+
+
+
xrandr --output VGA1 --mode 1024x768 --same-as LVDS1
+
+

i3 will then use the lowest common subset of screen resolutions, the rest of +your screen will be left untouched (it will show the X background). So, in +our example, this would be 1024x768 (my notebook has 1280x800).

+
+
+

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:

+
+
+
xrandr --output VGA1 --mode 1024x768 --right-of LVDS1
+
+

Now, i3 will put a new workspace (depending on your settings) on the new screen +and you are in multi-monitor mode (see [multi_monitor]).

+

Because i3 is not a compositing window manager, there is no ability to +display a window on two screens at the same time. Instead, your presentation +software needs to do this job (that is, open a window on each screen).

+
+
+
+

8.3. High-resolution displays (aka HIDPI displays)

+

See https://wiki.archlinux.org/index.php/HiDPI for details on how to enable +scaling in various parts of the Linux desktop. i3 will read the desired DPI from +the Xft.dpi property. The property defaults to 96 DPI, so to achieve 200% +scaling, you’d set Xft.dpi: 192 in ~/.Xresources.

+

If you are a long-time i3 user who just got a new monitor, double-check that:

+
    +
  • +

    +You are using a scalable font (starting with “pango:”) in your i3 config. +

    +
  • +
  • +

    +You are using a terminal emulator which supports scaling. You could + temporarily switch to gnome-terminal, which is known to support scaling out of + the box, until you figure out how to adjust the font size in your favorite + terminal emulator. +

    +
  • +
+
+
+
+
+

+ + + diff --git a/docs/wsbar.html b/docs/wsbar.html new file mode 100644 index 0000000..02dc32e --- /dev/null +++ b/docs/wsbar.html @@ -0,0 +1,851 @@ + + + + + + +External workspace bars + + + + + +
+
+
+

i3 comes with i3bar by default, a simple bar that is sufficient for most users. +In case you are unhappy with it, this document explains how to use a different, +external workspace bar. Note that we do not provide support for external +programs.

+
+
+
+

1. Internal and external bars

+
+

The internal workspace bar of i3 is meant to be a reasonable default so that +you can use i3 without having too much hassle when setting it up. It is quite +simple and intended to stay this way.

+
+
+
+

2. dock mode

+
+

You typically want to see the same workspace bar on every workspace on a +specific screen. Also, you don’t want to place the workspace bar somewhere +in your layout by hand. This is where dock mode comes in: When a program sets +the appropriate hint (_NET_WM_WINDOW_TYPE_DOCK), it will be managed in dock +mode by i3. That means it will be placed at the bottom or top of the screen +(while other edges of the screen are possible in the NetWM standard, this is +not yet implemented in i3), it will not overlap any other window and it will be +on every workspace for the specific screen it was placed on initially.

+
+
+
+

3. The IPC interface

+
+

In the context of using an external workspace bar, the IPC interface needs to +provide the bar program with the current workspaces and output (as in VGA-1, +LVDS-1, …) configuration. In the other direction, the program has to be able +to switch to specific workspaces.

+

By default, the IPC interface is enabled and you can get the path to the socket +by calling i3 --get-socketpath.

+

To learn more about the protocol which is used for IPC, see docs/ipc.

+
+
+
+

4. Output changes (on-the-fly)

+
+

i3 implements the RandR API and can handle changing outputs quite well. So, an +external workspace bar implementation needs to make sure that when you change +the resolution of any of your screens (or enable/disable an output), the bars +will be adjusted properly.

+
+
+
+

5. i3-wsbar, an example implementation

+
+

i3-wsbar used to be the reference implementation before we had i3bar. +Nowadays, it is not shipped with release tarballs, but you can still get it at +https://github.com/i3/i3/blob/next/contrib/i3-wsbar

+
+

5.1. The big picture

+

The most common reason to use an external workspace bar is to integrate system +information such as what i3status or conky provide into the workspace bar. +So, we have i3status or a similar program, which only provides +text output (formatted in some way). To display this text nicely on the screen, +there are programs such as dzen2, xmobar and similar. We will stick to dzen2 +from here on. So, we have the output of i3status, which needs to go into dzen2 +somehow. But we also want to display the list of workspaces. i3-wsbar takes +input on stdin, combines it with a formatted workspace list and pipes it to +dzen2.

+

Please note that i3-wsbar does not print its output to stdout. Instead, it +launches the dzen2 instances on its own. This is necessary to handle changes +in the available outputs (to place a new dzen2 on a new screen for example).

+

+ +Overview + +

+
+
+

5.2. Running i3-wsbar

+

The most simple usage of i3-wsbar looks like this:

+
+
+
i3-wsbar -c "dzen2 -x %x -dock"
+
+

The %x in the command name will be replaced by the X position of the output +for which this workspace bar is running. i3 will automatically place the +workspace bar on the correct output when dzen2 is started in dock mode. The +bar which you will see should look exactly like the internal bar of i3.

+

To actually get a benefit, you want to give i3-wsbar some input:

+
+
+
i3status | i3-wsbar -c "dzen2 -x %x -dock"
+
+
+
+
+
+

+ + + diff --git a/man/i3-config-wizard.1 b/man/i3-config-wizard.1 new file mode 100644 index 0000000..6dfb1ac --- /dev/null +++ b/man/i3-config-wizard.1 @@ -0,0 +1,70 @@ +'\" t +.\" Title: i3-config-wizard +.\" Author: [see the "AUTHOR" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 08/30/2019 +.\" Manual: i3 Manual +.\" Source: i3 4.17.1 +.\" Language: English +.\" +.TH "I3\-CONFIG\-WIZARD" "1" "08/30/2019" "i3 4\&.17\&.1" "i3 Manual" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +i3-config-wizard \- creates a keysym based config based on your layout +.SH "SYNOPSIS" +.sp +i3\-config\-wizard [\fB\-s\fR \fIsocket\fR] [\fB\-m\fR \fImodifier\fR] [\fB\-v\fR] [\fB\-h\fR] +.SH "OPTIONS" +.PP +\fB\-s, \-\-socket\fR \fIsocket\fR +.RS 4 +Overwrites the path to the i3 IPC socket\&. +.RE +.PP +\fB\-m, \-\-modifier\fR \fImodifier\fR +.RS 4 +Generates the configuration file headlessly\&. Accepts win or alt\&. +.RE +.PP +\fB\-v, \-\-version\fR +.RS 4 +Display version number and exit\&. +.RE +.PP +\fB\-h, \-\-help\fR +.RS 4 +Display a short help message and exit\&. +.RE +.SH "FILES" +.SS "/etc/i3/config\&.keycodes" +.sp +This file contains the default configuration with keycodes\&. All the bindcode lines will be transformed to bindsym and the user\-specified modifier will be used\&. +.SH "DESCRIPTION" +.sp +i3\-config\-wizard is started by i3 in its default config, unless /\&.i3/config exists\&. i3\-config\-wizard creates a keysym based i3 config file (based on /etc/i3/config\&.keycodes) in /\&.i3/config\&. +.sp +The advantage of using keysyms is that the config file is easy to read, understand and modify\&. However, if we shipped with a keysym based default config file, the key positions would not be consistent across different keyboard layouts (take for example the homerow for movement)\&. Therefore, we ship with a keycode based default config and let the wizard transform it according to your current keyboard layout\&. +.SH "SEE ALSO" +.sp +i3(1) +.SH "AUTHOR" +.sp +Michael Stapelberg and contributors diff --git a/man/i3-dmenu-desktop.1 b/man/i3-dmenu-desktop.1 new file mode 100644 index 0000000..5099701 --- /dev/null +++ b/man/i3-dmenu-desktop.1 @@ -0,0 +1,148 @@ +.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" ======================================================================== +.\" +.IX Title "I3-DMENU-DESKTOP 1" +.TH I3-DMENU-DESKTOP 1 "2019-08-30" "perl v5.28.1" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +.Vb 1 +\& i3\-dmenu\-desktop \- run .desktop files with dmenu +.Ve +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 1 +\& i3\-dmenu\-desktop [\-\-dmenu=\*(Aqdmenu \-i\*(Aq] [\-\-entry\-type=name] +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +i3\-dmenu\-desktop is a script which extracts the (localized) name from +application .desktop files, offers the user a choice via \fBdmenu\fR\|(1) and then +starts the chosen application via i3 (for startup notification support). +The advantage of using .desktop files instead of \fBdmenu_run\fR\|(1) is that dmenu_run +offers \fBall\fR binaries in your \f(CW$PATH\fR, including non-interactive utilities like +\&\*(L"sed\*(R". Also, .desktop files contain a proper name, information about whether +the application runs in a terminal and whether it supports startup +notifications. +.PP +The .desktop files are searched in \f(CW$XDG_DATA_HOME\fR/applications (by default +\&\f(CW$HOME\fR/.local/share/applications) and in the \*(L"applications\*(R" subdirectory of each +entry of \f(CW$XDG_DATA_DIRS\fR (by default /usr/local/share/:/usr/share/). +.PP +Files with the same name in \f(CW$XDG_DATA_HOME\fR/applications take precedence over +files in \f(CW$XDG_DATA_DIRS\fR, so that you can overwrite parts of the system-wide +\&.desktop files by copying them to your local directory and making changes. +.PP +i3\-dmenu\-desktop displays the \*(L"Name\*(R" value in the localized version depending +on \s-1LC_MESSAGES\s0 as specified in the Desktop Entry Specification. +.PP +You can pass a filename or \s-1URL\s0 (%f/%F and \f(CW%u\fR/%U field codes in the .desktop +file respectively) by appending it to the name of the application. E.g., if you +want to launch \*(L"\s-1GNU\s0 Emacs 24\*(R" with the patch /tmp/foobar.txt, you would type +\&\*(L"emacs\*(R", press \s-1TAB,\s0 type \*(L" /tmp/foobar.txt\*(R" and press \s-1ENTER.\s0 +.PP +\&.desktop files with Terminal=true are started using \fBi3\-sensible\-terminal\fR\|(1). +.PP +\&.desktop files with NoDisplay=true or Hidden=true are skipped. +.PP +\&\s-1UTF\-8\s0 is supported, of course, but dmenu does not support displaying all +glyphs. E.g., xfce4\-terminal.desktop's Name[fi]=Pääte will be displayed just +fine, but not its Name[ru]=Терминал. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-\-dmenu=command\fR" 4 +.IX Item "--dmenu=command" +Execute command instead of 'dmenu \-i'. This option can be used to pass custom +parameters to dmenu, or to make i3\-dmenu\-desktop start a custom (patched?) +version of dmenu. +.IP "\fB\-\-entry\-type=type\fR" 4 +.IX Item "--entry-type=type" +Display the (localized) \*(L"Name\*(R" (type = name), the command (type = command) or +the (*.desktop) filename (type = filename) in dmenu. This option can be +specified multiple times. +.Sp +Examples are \*(L"\s-1GNU\s0 Image Manipulation Program\*(R" (type = name), \*(L"gimp\*(R" (type = +command), and \*(L"libreoffice-writer\*(R" (type = filename). +.SH "VERSION" +.IX Header "VERSION" +Version 1.5 +.SH "AUTHOR" +.IX Header "AUTHOR" +Michael Stapelberg, \f(CW\*(C`\*(C'\fR +.SH "LICENSE AND COPYRIGHT" +.IX Header "LICENSE AND COPYRIGHT" +Copyright 2012 Michael Stapelberg. +.PP +This program is free software; you can redistribute it and/or modify it +under the terms of the \s-1BSD\s0 license. diff --git a/man/i3-dump-log.1 b/man/i3-dump-log.1 new file mode 100644 index 0000000..5d41a34 --- /dev/null +++ b/man/i3-dump-log.1 @@ -0,0 +1,50 @@ +'\" t +.\" Title: i3-dump-log +.\" Author: [see the "AUTHOR" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 08/30/2019 +.\" Manual: i3 Manual +.\" Source: i3 4.17.1 +.\" Language: English +.\" +.TH "I3\-DUMP\-LOG" "1" "08/30/2019" "i3 4\&.17\&.1" "i3 Manual" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +i3-dump-log \- dumps the i3 SHM log +.SH "SYNOPSIS" +.sp +i3\-dump\-log [\-s ] [\-f] +.SH "DESCRIPTION" +.sp +Debug versions of i3 automatically use 1% of your RAM (but 25 MiB max) to store full debug log output\&. This is extremely helpful for bugreports and figuring out what is going on, without permanently logging to a file\&. +.sp +With i3\-dump\-log, you can dump the SHM log to stdout\&. +.sp +The \-f flag works like tail \-f, i\&.e\&. the process does not terminate after dumping the log, but prints new lines as they appear\&. +.SH "EXAMPLE" +.sp +i3\-dump\-log | gzip \-9 > /tmp/i3\-log\&.gz +.SH "SEE ALSO" +.sp +i3(1) +.SH "AUTHOR" +.sp +Michael Stapelberg and contributors diff --git a/man/i3-input.1 b/man/i3-input.1 new file mode 100644 index 0000000..f3d86f2 --- /dev/null +++ b/man/i3-input.1 @@ -0,0 +1,154 @@ +'\" t +.\" Title: i3-input +.\" Author: [see the "AUTHOR" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 08/30/2019 +.\" Manual: i3 Manual +.\" Source: i3 4.17.1 +.\" Language: English +.\" +.TH "I3\-INPUT" "1" "08/30/2019" "i3 4\&.17\&.1" "i3 Manual" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +i3-input \- interactively take a command for i3 window manager +.SH "SYNOPSIS" +.sp +i3\-input [\-s ] [\-F ] [\-l ] [\-P ] [\-f ] [\-v] +.SH "DESCRIPTION" +.sp +i3\-input is a tool to take commands (or parts of a command) composed by the user, and send it/them to i3\&. This is useful, for example, for the mark/goto command\&. +.sp +You can press Escape to close i3\-input without sending any commands\&. +.SH "OPTIONS" +.PP +\-s +.RS 4 +Specify the path to the i3 IPC socket (it should not be necessary to use this option, i3\-input will figure out the path on its own)\&. +.RE +.PP +\-F +.RS 4 +Every occurrence of "%s" in the string is replaced by the user input, and the result is sent to i3 as a command\&. Default value is "%s"\&. +.RE +.PP +\-l +.RS 4 +Set the maximum allowed length of the user input to characters\&. i3\-input will automatically issue the command when the user input reaches that length\&. +.RE +.PP +\-P +.RS 4 +Display the string in front of user input text field\&. The prompt string is not included in the user input/command\&. +.RE +.PP +\-f +.RS 4 +Use the specified X11 core font (use +xfontsel +to chose a font)\&. +.RE +.PP +\-v +.RS 4 +Show version and exit\&. +.RE +.SH "EXAMPLES" +.sp +Mark a container with a single character: +.sp +.if n \{\ +.RS 4 +.\} +.nf +i3\-input \-F \*(Aqmark %s\*(Aq \-l 1 \-P \*(AqMark: \*(Aq +.fi +.if n \{\ +.RE +.\} +.sp +Go to the container marked with above example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +i3\-input \-F \*(Aq[con_mark="%s"] focus\*(Aq \-l 1 \-P \*(AqGo to: \*(Aq +.fi +.if n \{\ +.RE +.\} +.SH "ENVIRONMENT" +.SS "I3SOCK" +.sp +i3\-input handles the different sources of socket paths in the following order: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +I3SOCK environment variable +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +I3SOCK gets overwritten by the \-s parameter, if specified +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +if neither are available, i3\-input reads the socket path from the X11 property, which is the recommended way +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +if everything fails, i3\-input tries +/tmp/i3\-ipc\&.sock +.RE +.sp +The socket path is necessary to connect to i3 and actually issue the command\&. +.SH "SEE ALSO" +.sp +i3(1) +.SH "AUTHOR" +.sp +Michael Stapelberg and contributors diff --git a/man/i3-migrate-config-to-v4.1 b/man/i3-migrate-config-to-v4.1 new file mode 100644 index 0000000..17c9e4f --- /dev/null +++ b/man/i3-migrate-config-to-v4.1 @@ -0,0 +1,48 @@ +'\" t +.\" Title: i3-migrate-config-to-v4 +.\" Author: [see the "AUTHOR" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 08/30/2019 +.\" Manual: i3 Manual +.\" Source: i3 4.17.1 +.\" Language: English +.\" +.TH "I3\-MIGRATE\-CONFIG\" "1" "08/30/2019" "i3 4\&.17\&.1" "i3 Manual" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +i3-migrate-config-to-v4 \- migrates your i3 config file +.SH "SYNOPSIS" +.sp +.nf +mv ~/\&.i3/config ~/\&.i3/old\&.config +i3\-migrate\-config\-to\-v4 ~/\&.i3/old\&.config > ~/\&.i3/config +.fi +.SH "DESCRIPTION" +.sp +i3\-migrate\-config\-to\-v4 is a Perl script which migrates your old (< version 4) configuration files to a version 4 config file\&. The most significant changes are the new commands (see the release notes)\&. +.sp +This script will automatically be run by i3 when it detects an old config file\&. Please migrate your config file as soon as possible\&. We plan to include this script in all i3 release until 2012\-08\-01\&. Afterwards, old config files will no longer be supported\&. +.SH "SEE ALSO" +.sp +i3(1) +.SH "AUTHOR" +.sp +Michael Stapelberg and contributors diff --git a/man/i3-msg.1 b/man/i3-msg.1 new file mode 100644 index 0000000..628d49d --- /dev/null +++ b/man/i3-msg.1 @@ -0,0 +1,164 @@ +'\" t +.\" Title: i3-msg +.\" Author: [see the "AUTHOR" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 08/30/2019 +.\" Manual: i3 Manual +.\" Source: i3 4.17.1 +.\" Language: English +.\" +.TH "I3\-MSG" "1" "08/30/2019" "i3 4\&.17\&.1" "i3 Manual" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +i3-msg \- send messages to i3 window manager +.SH "SYNOPSIS" +.sp +i3\-msg [\-q] [\-v] [\-h] [\-s socket] [\-t type] [message] +.SH "OPTIONS" +.PP +\fB\-q, \-\-quiet\fR +.RS 4 +Only send ipc message and suppress the output of the response\&. +.RE +.PP +\fB\-v, \-\-version\fR +.RS 4 +Display version number and exit\&. +.RE +.PP +\fB\-h, \-\-help\fR +.RS 4 +Display a short help\-message and exit\&. +.RE +.PP +\fB\-s, \-\-socket\fR \fIsock_path\fR +.RS 4 +i3\-msg will use the environment variable I3SOCK or the socket path given here\&. If both fail, it will try to get the socket information from the root window and then try /tmp/i3\-ipc\&.sock before exiting with an error\&. +.RE +.PP +\fB\-t\fR \fItype\fR +.RS 4 +Send ipc message, see below\&. This option defaults to "command"\&. +.RE +.PP +\fB\-m\fR, \fB\-\-monitor\fR +.RS 4 +Instead of exiting right after receiving the first subscribed event, wait indefinitely for all of them\&. Can only be used with "\-t subscribe"\&. See the "subscribe" IPC message type below for details\&. +.RE +.PP +\fBmessage\fR +.RS 4 +Send ipc message, see below\&. +.RE +.SH "IPC MESSAGE TYPES" +.PP +command +.RS 4 +The payload of the message is a command for i3 (like the commands you can bind to keys in the configuration file) and will be executed directly after receiving it\&. +.RE +.PP +get_workspaces +.RS 4 +Gets the current workspaces\&. The reply will be a JSON\-encoded list of workspaces\&. +.RE +.PP +get_outputs +.RS 4 +Gets the current outputs\&. The reply will be a JSON\-encoded list of outputs (see the reply section of docs/ipc, e\&.g\&. at +\m[blue]\fBhttps://i3wm\&.org/docs/ipc\&.html#_receiving_replies_from_i3\fR\m[])\&. +.RE +.PP +get_tree +.RS 4 +Gets the layout tree\&. i3 uses a tree as data structure which includes every container\&. The reply will be the JSON\-encoded tree\&. +.RE +.PP +get_marks +.RS 4 +Gets a list of marks (identifiers for containers to easily jump to them later)\&. The reply will be a JSON\-encoded list of window marks\&. +.RE +.PP +get_bar_config +.RS 4 +Gets the configuration (as JSON map) of the workspace bar with the given ID\&. If no ID is provided, an array with all configured bar IDs is returned instead\&. +.RE +.PP +get_binding_modes +.RS 4 +Gets a list of configured binding modes\&. +.RE +.PP +get_version +.RS 4 +Gets the version of i3\&. The reply will be a JSON\-encoded dictionary with the major, minor, patch and human\-readable version\&. +.RE +.PP +get_config +.RS 4 +Gets the currently loaded i3 configuration\&. +.RE +.PP +send_tick +.RS 4 +Sends a tick to all IPC connections which subscribe to tick events\&. +.RE +.PP +subscribe +.RS 4 +The payload of the message describes the events to subscribe to\&. Upon reception, each event will be dumped as a JSON\-encoded object\&. See the \-m option for continuous monitoring\&. +.RE +.SH "DESCRIPTION" +.sp +i3\-msg is a sample implementation for a client using the unix socket IPC interface to i3\&. +.SS "Exit status:" +.sp +0: if OK, 1: if invalid syntax or unable to connect to ipc\-socket 2: if i3 returned an error processing your command(s) +.SH "EXAMPLES" +.sp +.if n \{\ +.RS 4 +.\} +.nf +# Use 1\-px border for current client +i3\-msg "border 1pixel" + +# You can leave out the quotes +i3\-msg border normal + +# Dump the layout tree +i3\-msg \-t get_tree + +# Monitor window changes +i3\-msg \-t subscribe \-m \*(Aq[ "window" ]\*(Aq +.fi +.if n \{\ +.RE +.\} +.SH "ENVIRONMENT" +.SS "I3SOCK" +.sp +If no ipc\-socket is specified on the commandline, this variable is used to determine the path, at which the unix domain socket is expected, on which to connect to i3\&. +.SH "SEE ALSO" +.sp +i3(1) +.SH "AUTHOR" +.sp +Michael Stapelberg and contributors diff --git a/man/i3-nagbar.1 b/man/i3-nagbar.1 new file mode 100644 index 0000000..a8e73ac --- /dev/null +++ b/man/i3-nagbar.1 @@ -0,0 +1,96 @@ +'\" t +.\" Title: i3-nagbar +.\" Author: [see the "AUTHOR" section] +.\" Generator: DocBook XSL Stylesheets v1.79.1 +.\" Date: 08/30/2019 +.\" Manual: i3 Manual +.\" Source: i3 4.17.1 +.\" Language: English +.\" +.TH "I3\-NAGBAR" "1" "08/30/2019" "i3 4\&.17\&.1" "i3 Manual" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +i3-nagbar \- displays an error bar on top of your screen +.SH "SYNOPSIS" +.sp +i3\-nagbar [\-m ] [\-b