DISPLAY=:0 i3-dump-log | bzip2 -c | curl --data-binary @- http://logs.i3wm.org+
DISPLAY=:0 i3-dump-log | bzip2 -c | curl --data-binary @- https://logs.i3wm.org
From 34766c2a72c18bd20c3760d75d7c2aabbb2453dc Mon Sep 17 00:00:00 2001
From: Michael Stapelberg
Only the latest major version of i3 is supported. To verify which version you are running, use:
Your version is 85 commits newer than 4.7, and the git revision of your -version is 9c15b95. Go to http://code.i3wm.org/i3/commit/?h=next and see if -the line "commit" starts with the same revision. If so, you are using the +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.
To upload a compressed version of the logfile (for a bugreport), use:
DISPLAY=:0 i3-dump-log | bzip2 -c | curl --data-binary @- http://logs.i3wm.org+
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.
When debugging with us in IRC, be prepared to use a so called nopaste service -such as http://nopaste.info or http://pastebin.com because pasting large -amounts of text in IRC sometimes leads to incomplete lines (servers have line -length limitations) or flood kicks.
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.)
+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. +
+For a short introduction into using git, see +https://web.archive.org/web/20121024222556/http://www.spheredev.org/wiki/Git_for_the_lazy +or, for more documentation, see https://git-scm.com/documentation
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.
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â.
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 @@ -124,7 +228,7 @@ React to the userâs commands: Change focus, Move windows, Switch workspaces,
In the following chapters, each of these tasks and their implementation details will be discussed.
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 @@ -143,7 +247,7 @@ layout (like dwm, awesome, â¦) but provide mechanisms for you to easily create the layout you need at the moment.
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 @@ -154,13 +258,13 @@ 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 -http://i3wm.org/docs/ipc.html#_tree_reply for documentation on that and an +https://i3wm.org/docs/ipc.html#_tree_reply for documentation on that and an example.
See include/data.h for documented data structures. The most important ones are explained right here.
The data type is Con, in all cases.
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.
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.
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.
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 @@ -524,7 +628,7 @@ separate of each other. Other window managers also call this “Virtual desktops”.
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.
An X11 window container holds exactly one X11 window. These are the leaf nodes of the layout tree, they cannot have any children.
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 @@ -554,7 +658,7 @@ selected window to the window above/below.
There is a row of standard variables used in many events. The following names should be chosen for those:
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 @@ -644,7 +748,7 @@ 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.
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 @@ -655,7 +759,7 @@ event.
manage_window() does some checks to decide whether the window should be managed at all:
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 @@ -711,7 +815,7 @@ can reconfigure themselves).
Only the _NET_WM_STATE_FULLSCREEN and _NET_WM_STATE_DEMANDS_ATTENTION atoms are handled.
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 @@ -731,7 +835,7 @@ if present.
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 @@ -740,7 +844,7 @@ characters (every special character contained in your font).
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 @@ -753,7 +857,7 @@ src/layout.c, function resize_client().
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 @@ -773,7 +877,7 @@ 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.
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.
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 @@ -836,20 +940,20 @@ Recursively raise and render the outputâs child containers (meaning dock
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.
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.
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 @@ -860,20 +964,20 @@ reserved (or displayed later on), unless there is more than one window inside the stacked container.
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).
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.
A windowâs size and position will be determined in the following way:
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 @@ -932,7 +1036,7 @@ Expose event handling (drawing decorations): x_deco_recurse() and
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 @@ -1042,7 +1146,7 @@ unmapped if it should not be visible anymore. WM_STATE will be set to WM_STATE_WITHDRAWN.
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 @@ -1061,7 +1165,7 @@ and "1pixel") and the top bar (in case of border style "normal").
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, @@ -1103,7 +1207,7 @@ 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).
Letâs have a look at the WORKSPACE state, which is a good example of all features. This is its definition:
The following steps have to be taken in order to properly introduce a new command (or possibly extend an existing command):
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.
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).
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).
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:
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).
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)):
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.
Without much ado, here is the list of cases which need to be considered:
For a short introduction into using git, see -http://web.archive.org/web/20121024222556/http://www.spheredev.org/wiki/Git_for_the_lazy -or, for more documentation, see http://git-scm.com/documentation
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.
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â.
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.)
-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. -
-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, @@ -1601,7 +1600,7 @@ 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.
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 diff --git a/docs/i3bar-protocol.html b/docs/i3bar-protocol.html index a9478fc..4955b89 100644 --- a/docs/i3bar-protocol.html +++ b/docs/i3bar-protocol.html @@ -145,7 +145,7 @@ 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 -http://code.stapelberg.de/git/i3/tree/contrib/trivial-bar-script.sh?h=next
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).
Currently implemented message types are the following:
- 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. -
-- Gets the current workspaces. The reply will be a JSON-encoded list of - workspaces (see the reply section). -
-- Subscribes your connection to certain events. See [events] for a - description of this message and the concept of events. -
-- Gets the current outputs. The reply will be a JSON-encoded list of outputs - (see the reply section). -
-- Gets the layout tree. i3 uses a tree as data structure which includes - every container. The reply will be the JSON-encoded tree (see the reply - section). -
-- 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 (see - reply section). -
-- 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. -
-- Gets the version of i3. The reply will be a JSON-encoded dictionary - with the major, minor, patch and human-readable version. -
-- Gets a list of currently configured binding modes. -
-Type (numeric) | +Type (name) | +Reply type | +Purpose | +
---|---|---|---|
0 |
+RUN_COMMAND |
++ | Run the payload as an i3 command (like the commands you can bind to keys). |
+
1 |
+GET_WORKSPACES |
++ | Get the list of current workspaces. |
+
2 |
+SUBSCRIBE |
++ | Subscribe this IPC connection to the event types specified in the message payload. See [events]. |
+
3 |
+GET_OUTPUTS |
++ | Get the list of current outputs. |
+
4 |
+GET_TREE |
++ | Get the i3 layout tree. |
+
5 |
+GET_MARKS |
++ | Gets the names of all currently set marks. |
+
6 |
+GET_BAR_CONFIG |
++ | Gets the specified bar configuration or the names of all bar configurations if payload is empty. |
+
7 |
+GET_VERSION |
++ | Gets the i3 version. |
+
8 |
+GET_BINDING_MODES |
++ | Gets the names of all currently configured binding modes. |
+
9 |
+GET_CONFIG |
++ | Returns the last loaded i3 config. |
+
So, a typical message could look like this:
- Confirmation/Error code for the COMMAND message. + Confirmation/Error code for the RUN_COMMAND message.
+ Reply to the GET_CONFIG message. +
+- Whether this container (window or workspace) has the urgency hint set. + 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.
+ 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. +
++ The tiling (i.e. non-floating) child containers of this 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 @@ -1142,6 +1176,16 @@ loaded_config_file_name (string)
["default", "resize"]
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" }+
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:
+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. +
++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. +
++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. +
++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. +
++From here on out, send/receive all messages using the detected byte order. +
+Note: Swallowing windows into unsatisfied placeholder windows takes precedence over -assignment +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 @@ -202,7 +202,7 @@ a Chrome window:
The structure of this JSON file looks a lot like the TREE reply, see -http://build.i3wm.org/docs/ipc.html#_tree_reply for documentation on that. Some +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 @@ -268,8 +268,8 @@ Layout files contain comments which are not standardized, but understood by 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.
The latest Perl documentation of the "i3test" (general testcase setup) and "i3test::Test" (additional test instructions) modules: - http://build.i3wm.org/docs/lib-i3test.html respectively - http://build.i3wm.org/docs/lib-i3test-test.html + https://build.i3wm.org/docs/lib-i3test.html respectively + https://build.i3wm.org/docs/lib-i3test-test.html
The latest documentation on i3âs IPC interface: - http://build.i3wm.org/docs/ipc.html + https://build.i3wm.org/docs/ipc.html
The tests additionally require Xephyr(1) to run a nested X server. Install -xserver-xephyr on Debian or xorg-xserver-xephyr on Arch Linux.
If you donât want to use cpanminus for some reason, the same works with 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 http://michael.stapelberg.de/cpan/
See [http://i3wm.org/docs/ipc.html] for documentation on the IPC interface.
See [https://i3wm.org/docs/ipc.html] for documentation on the IPC interface.
The first part of the WM_CLASS is the instance ("irssi" in this example), the second part is the class ("URxvt" in this example).
Should you have any problems with assignments, make sure to check the i3 -logfile first (see http://i3wm.org/docs/debugging.html). It includes more +logfile first (see https://i3wm.org/docs/debugging.html). It includes more details about the matching process and the windowâs actual class, instance and title when starting up.
Note that if you want to start an application just once on a specific @@ -909,6 +909,16 @@ the second screen and so on).
The output is the name of the RandR output you attach your screen to. On a laptop, you might have VGA1 and LVDS1 as output names. You can see the available outputs by running xrandr --current.
If your X server supports RandR 1.5 or newer, i3 will use RandR monitor objects +instead of output objects. Run xrandr --listmonitors to see a list. Usually, +a monitor object contains exactly one output, and has the same name as the +output; but should that not be the case, you may specify the name of either the +monitor or the output in i3’s configuration. For example, the Dell UP2414Q uses +two scalers internally, so its output names might be âDP1â and âDP2â, but the +monitor name is âDell UP2414Qâ.
(Note that even if you specify the name of an output which doesn’t span the +entire monitor, i3 will still use the entire area of the containing monitor +rather than that of just the output’s.)
If you use named workspaces, they must be quoted:
Examples:
As explained in-depth in http://i3wm.org/docs/multi-monitor.html, some X11 +
As explained in-depth in https://i3wm.org/docs/multi-monitor.html, some X11 video drivers (especially the nVidia binary driver) only provide support for Xinerama instead of RandR. In such a situation, i3 must be told to use the inferior Xinerama API explicitly and therefore donât provide support for @@ -2230,77 +2240,97 @@ bindsym $mod+x focus output HDMI-2 # Focus the primary output bindsym $mod+x focus output primary
Note that you might not have a primary output configured yet. To do so, run:
Note that you might not have a primary output configured yet. To do so, run:+
xrandr --output <output> --primary
xrandr --output <output> --primary
Use the move command to move a container.
Syntax:
=== Moving containers - -Use the +move+ command to move a container. - -*Syntax*:-
# Moves the container into the given direction. +
# Moves the container into the given direction. # The optional pixel argument specifies how far the # container should be moved if it is floating and # defaults to 10 pixels. -move <left|right|down|up> [<px> px]
# Moves the container either to a specific location -# or to the center of the screen. If absolute is +move <left|right|down|up> [<px> px] + +# Moves the container either to a specific location +# or to the center of the screen. If 'absolute' is # used, it is moved to the center of all outputs. move [absolute] position <pos_x> [px] <pos_y> [px] -move [absolute] position center
# Moves the container to the current position of the +move [absolute] position center + +# Moves the container to the current position of the # mouse cursor. Only affects floating containers. -move position mouse
Examples:
*Examples*:-
# Move container to the left, bottom, top, right +
# Move container to the left, bottom, top, right bindsym $mod+j move left bindsym $mod+k move down bindsym $mod+l move up -bindsym $mod+semicolon move right
# Move container, but make floating containers +bindsym $mod+semicolon move right + +# Move container, but make floating containers # move more than the default -bindsym $mod+j move left 20 px
# Move floating container to the center of all outputs -bindsym $mod+c move absolute position center
# Move container to the current position of the cursor -bindsym $mod+m move position mouse
=== Swapping containers +bindsym $mod+j move left 20 px -Two containers can be swapped (i.e., move to each other's position) by using -the +swap+ command. They will assume the position and geometry of the container -they are swapped with. +# Move floating container to the center of all outputs +bindsym $mod+c move absolute position center -The first container to participate in the swapping can be selected through the +# Move container to the current position of the cursor +bindsym $mod+m move position mouse+
Two containers can be swapped (i.e., move to each other’s position) by using +the swap command. They will assume the position and geometry of the container +they are swapped with.
The first container to participate in the swapping can be selected through the normal command criteria process with the focused window being the usual fallback if no criteria are specified. The second container can be selected -using one of the following methods: - -+id+:: The X11 window ID of a client window. -+con_id+:: The i3 container ID of a container. -+mark+:: A container with the specified mark, see <<vim_like_marks>>. - -Note that swapping does not work with all containers. Most notably, swapping +using one of the following methods:
+The X11 window ID of a client window. +
++The i3 container ID of a container. +
++A container with the specified mark, see [vim_like_marks]. +
+Note that swapping does not work with all containers. Most notably, swapping floating containers or containers that have a parent-child relationship to one -another does not work. - -*Syntax*: +another does not work.
Syntax:
swap container with id|con_id|mark <arg>
Examples:
If you want a window to stick to the glass, i.e., have it stay on screen even if you switch to another workspace, you can use the sticky command. For example, this can be useful for notepads, a media player or a video chat @@ -2331,7 +2362,7 @@ for_window [instance=notepad] sticky enable
To change to a specific workspace, use the workspace command, followed by the number or name of the workspace. Pass the optional flag --no-auto-back-and-forth to disable [back_and_forth] for this specific call @@ -2391,7 +2422,7 @@ bindsym $mod+x move workspace to output right bindsym $mod+F1 [class="Firefox"] move workspace current
Workspaces are identified by their name. So, instead of using numbers in the workspace command, you can use an arbitrary name:
Example:
You can rename workspaces. This might be useful to start with the default numbered workspaces, do your work, and rename the workspaces afterwards to reflect whatâs actually on them. You can also omit the old name to rename @@ -2457,12 +2488,12 @@ to "1: web", the above command will still switch to it.
See [move_to_outputs] for how to move a container/workspace to a different RandR output.
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:
Example:
for_window [instance="tabme"] move window to mark target
If you want to resize containers/windows using your keyboard, you can use the resize command:
Syntax:
Often when in a multi-monitor environment, you want to quickly jump to a specific window. For example, while working on workspace 3 you may want to jump to your mail client to email your boss that youâve achieved some @@ -2565,7 +2596,7 @@ bindsym $mod+a [class="urxvt" title="VIM"] focus
This feature is like the jump feature: It allows you to directly jump to a specific window (this means switching to the appropriate workspace and setting focus to the windows). However, you can directly mark a specific window with @@ -2608,7 +2639,7 @@ unmark irssi
By default, i3 will simply print the X11 window title. Using title_format, this can be customized by setting the format to the desired output. This directive supports @@ -2666,7 +2697,7 @@ for_window [class="(?i)firefox"] title_format "<span foreground='red'>%tit
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.
As described in http://i3wm.org/docs/debugging.html, i3 can log to a shared +
As described in https://i3wm.org/docs/debugging.html, i3 can log to a shared memory buffer, which you can dump using i3-dump-log. The shmlog command allows you to enable or disable the shared memory logging at runtime.
Note that when using shmlog <size_in_bytes>, the current log will be @@ -2719,7 +2750,7 @@ i3-msg shmlog $((50*1024*1024))
The debuglog command allows you to enable or disable debug logging at runtime. Debug logging is much more verbose than non-debug logging. This command does not activate shared memory logging (shmlog), and as such is most @@ -2737,7 +2768,7 @@ bindsym $mod+x debuglog toggle
You can make i3 reload its configuration file with reload. You can also restart i3 inplace with the restart command to get it out of some weird state (if that should ever happen) or to perform an upgrade without having to restart @@ -2752,7 +2783,7 @@ bindsym $mod+Shift+e exit
There are two commands to use any existing window as scratchpad window. move scratchpad will move a window to the scratchpad workspace. This will make it invisible until you show it again. There is no way to open that workspace. @@ -2787,7 +2818,7 @@ bindsym mod4+s [title="^Sup ::"] scratchpad show
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.
There are two options in the configuration of each i3bar instance that can be changed during runtime by invoking a command through i3. The commands bar hidden_state and bar mode allow setting the current hidden_state @@ -2841,7 +2872,7 @@ bindsym $mod+Shift+b bar mode invisible bar-1
As you can see in the goal list on the website, i3 was specifically developed with support for multiple monitors in mind. This section will explain how to @@ -2864,7 +2895,7 @@ create an unlimited number of workspaces in i3 and tie them to specific screens, you can have the "traditional" approach of having X workspaces per screen by changing your configuration (using modes, for example).
To help you get going if you have never used multiple monitors before, here is a short overview of the xrandr options which will probably be of interest to you. It is always useful to get an overview of the current screen configuration. @@ -2927,7 +2958,7 @@ only what you can see in xrandr.
See also [presentations] for more examples of multi-monitor setups.
There are several things to configure in i3 which may be interesting if you have more than one monitor:
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.
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.
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:
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:
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 -http://code.stapelberg.de/git/i3/tree/contrib/i3-wsbar
The most common reason to use an external workspace bar is to integrate system -- 2.39.5