Tiled window manager i3

I would like to continue what I started yesterday Jagajaga the topic of tile window managers with a story about another of their representatives - i3wm . Unlike awesome, its settings are written in a plain text file.

Features of i3wm for the user: correct support for multiple monitors (see the screen at the end), a simple text config file, no need to rebuild wm after changing the settings, three window layout modes, the dmenu application launch menu, creates desktops as needed and removes empty ones. out of the box has an excellent dashboard showing the level of Wi-Fi network, battery power and much more.

Demo from the author i3


i3wm is featured in the repositories of Debian, Arch, Gentoo, Ubunto, FreeBSD, NetBSD, OpenBSD, OpenSUSE, Mageia, Fedora, and Exerbo. I will talk about Ubuntu 12.04 as an example.

The desired package is called i3, so:
# apt-get install i3

Now on the user and password entry screen, you can select “i3” as the window manager.


At the first start, you will be prompted to select a modifier key. I chose win for compatibility with most applications.

Add switching to the Russian layout by Alt + Shift, autoload dropbox, switching between desktops by mod + Control + Left / Right, screen lock by mod + Control + l and sleep mode with a screen lock when exiting it by mod + Control + s .

Keyboard layout switching is configured using setxkbmap. Serves for this
$ setxkbmap "us,ru" ",winkeys" "grp:alt_shift_toggle"

In order not to enter it every time after a reboot, we will create the .xsessionrc file in the user's root folder, make it executable and bring it to the form
exec setxkbmap "us,ru" ",winkeys" "grp:alt_shift_toggle"

For startup, Dropbox .xsessionrc will look like this:
exec setxkbmap "us,ru" ",winkeys" "grp:alt_shift_toggle" &
dropbox start &

Now, the next time you enter i3wm, the Russian and English keyboards will be available.

Configuring i3 is usually done using a user config. Create the ~ / .i3 folder and copy the configuration template into it:
$ cp /etc/i3/config ~/.i3/config

Now you can choose the settings for yourself based on the documentation . I added the following lines:
# lock screen
bindsym $mod+Control+l exec i3lock
# lock screen and suspend
bindsym $mod+Control+s exec i3lock && dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend
# switch workspaces by mod+ctrl+left/right
bindsym $mod+Control+Left workspace prev
bindsym $mod+Control+Right workspace next

My config .


Some standard hotkeys that work by default:
mod + Enter opens the terminal
mod + d launches dmenu (a menu at the top of the screen that as you type the application name suggests options for launching)
mod + Shift + Q closes the active window
mod + v enables vertical tiling mode (the screen will be divided horizontally)
mod + h enables the horizontal tiling mode (the screen will be divided vertically)
mod + w enables the tab mode (each window on the desktop occupies the entire screen, tabs are visible from above)
mod + s turns on the stack mode (window titles are one below the other, each window occupies the entire screen)
mod + e returns the standard mode
mod + Shift + Space switches the window to floating mode and back
mod + Left / Right / Up / Down moves focus within the desktop
mod + Shift + Left / Right / Up / Down moves the current window within the desktop
mod + 1 , etc. switches to the desktop with the specified number
mod + Shift + C reads the settings from the configuration file
mod + Shift + E leaves i3wm to enter the username and password screen

Full capabilities for configuring and using i3wm are described in the documentation .

Cheatsheet with hot keys, convenient hint pictures from the author’s site:


If you have two monitors, or a built-in netbook screen and an external monitor, like mine, then i3wm will work fine on them. Most importantly, this does not require any additional settings.

List of available monitors:
$ xrandr -q

Set up their work in pairs:
$ xrandr --output LVDS1 --mode 1366x768 --pos 0x0 --output VGA1  --mode 1280x1024 --pos 1366x0

where LVD1 is the monitor built into the netbook, its resolution is 1366x768 and it is pressed to the upper left corner, VGA1 is an external monitor, its resolution is 1280x1024 and it is shifted 1366 pixels to the right relative to the upper left corner.

Is there a result! Left netbook built-in screen, the right external monitor
Habrazhitel burjui shared a link to an i3 video from GoogleTechTalks .