Using the i3 window manager

A colleague of mine suggested that I should try tiling window managers, and proceeded to produce a list of them, including i3, awesome, wmii and xmonad.

Having not used any tiling window manager for more than 5 seconds before, I decided to try them, and finally settled for i3, because I got it to work in less than 5 minutes, and it just feel "right" to me.


As usual on debian-based systems, it all starts with an:

sudo apt-get install i3

Pretty straightforward :)

The installer guides you through some kind of wizard, where the only meaningful decision is whether to have your "modifier" key be Alt or the famous "windows" key.

Running i3 for the first time

i3's interface is quite minimal (to say the least). First good news, it picks up multiple monitors without hiccups. Launching a terminal is as simple as mod+enter.

The documentation is great, simple but direct. I highly encourage the reader to bookmark it for future reference.

Some tweaks

Here's a list of tweaks I had to make to the default i3 config to make the system behave as I wanted.

GTK theme

i3 does not come with the GNOME bells and whistles, and so the default look for GTK programs is quite ugly.

Hopefully, a simple edit of the i3 config file (in ~/.i3/config) makes it beautiful again, and painless. Add the following to the bottom of that file:

exec --no-startup-id gnome-settings-daemon

All "exec" additions need you to restart i3 to take effect (log out by pressing mod-shift-e - "e" for exit).

Network mangement

Out of the box, i3 has no provision for a wireless selection mechanism. While possible, I would rather not have to fill in wireless details by hand in a config file every time (it's 2013!).

Adding the following exec line to the config file did the trick:

exec --no-startup-id nm-applet

You need to restart i3 for the change to take effect. i3 supports gnome applets in its bottom status bar, so all is well and you can interact with the NetworkManager applet just as you would in Unity or GNOME.

Sound management

In the same idea, I use a lot of different pulseaudio sinks, and I wanted to be able to switch from one output to the other easily.

Again, adding an exec line to the i3 config file was the charm:

exec --no-startup-id gnome-sound-applet

You know the drill - you need to restart i3 for this to work.

Desktop background

While completely unnecessary with a tiling VM since you don't see your background picture very often by design, I like having one, so I decided to use feh to set the root X window (what "the background" is in i3) to my favorite picture of the month. So here's the magic exec line (as usual) to put in your .i3/config file, after the obvious sudo apt-get install feh:

exec --no-startup-id feh --bg-fill /path/to/penguin/picture.jpg

Locking your screen

A last nitpick for the perfect i3 desktop for me was the ability to quickly lock my screen, ideally using the default Ubuntu lockscreen.

It's very easy, and as usual a small line in your ~/.i3/config file does the trick:

bindsym $mod+Shift+o exec "gnome-screensaver-command --lock "

Since by default $mod-shift-l is already bound to "move the active window down" I opted to bind the lock to O instead. But feel free to set it to anything else of course :)

More tweaks?

I'm sure some more could be done or added to this, but so far, this was all I needed to use i3 on a day-to-day basis.

Feel free to get in touch with me if you have more tips to share!