Personal tools
i3, an open source window manager for advanced users and developers

A person who is gifted sees the essential point and leaves the rest as surplus. (cit. Thomas Carlyle)

Feb 10, 2014

i3, an open source window manager for advanced users and developers

Let's take a look at this window manager that let you take full control of your workspace and let you summon each and every window in just one shortcut

Introduction - What is a window manager?

To fully understand the potential of i3 wm I think I should start with recalling the meaning of "window manager". Taking a look at wikipedia you can easily find out that a window manager is a "system software that controls the placement and appearance of windows within a windowing system in a graphical user interface".

Also this schema (taken from wikipedia) is quite explanatory, a window manager basically is a system that lays just under the desktop environment and helps the display manager (like the X server) to organize the windows on the screen. There are 4 main types of window manager:

  • compositing wm, i.e., Compiz
  • stacking wm, i.e., MS Windows
  • tiling wm, i.e., i3
  • dynamic wm, i.e., awesome.

I won't get in a detailed description of each type of window manager, for which you can find many documentation on the web. I will focus this blogpost on the tiling windows managers and in particular on i3 wm.

Tiling window managers

A tiling window manager is a wm that positions all the windows side by side on the screen in a non-overlapping way. This approach is not exactly new and has been used by MS Windows 1.0 too. Starting from the version 2.0 though it switched to the now more popular approach of coordinate-based stacking of overlapping objects.
If this is not new not cool and not very well know, one would rightly question why should I use such a system? Well quite easy to answer: I'm not a cool kid, I hate the main stream and, more seriously, this approach is perfect for a developer.

By this I mean that you can customize practically everything on your workspace, you can decide which window goes in which workspace, you can decide which workspace goes in which screen. Then you can move workspaces between monitors and windows between workspaces. And the amazing part is that all this is just one shortcut away from here.

i3

The home page of the project led by Michael Stapelberg says that "i3 is a tiling window manager, completely written from scratch... our code is Free and Open Source Software (FOSS) under the BSD license".

The main pros that made me choose i3 when I was deciding which tiling wm to use were:
- well readable, well documented code and excellent documentation
- it behaves perfectly in a multi-monitor system
- it implements modes (like my beloved vim)
- plain text configuration
- on-the-fly relaod (no reboot, no re-compile)
- system tray support.

These were my personal pros for choosing i3 among the others, if you want to have a big picture you can take a look a this well done comparison of tiling wms.

Getting started

Another main advantage of i3 among the other wms is that is packaged for almost every big distribution of linux and bsd and it can be installed in the usual way using your distribution specific package manager.
One of the very few downsides of i3 is that, after a very brief initial wizard that will create your basic config, you'll be practically lost. No menu, no icon, no tutorial... nothing!

After trying many combinations of shortcuts, I finally found out that one of the most important shortcut to get started is Win+Enter. This will open your "i3-sensible-terminal". This is basically a wrapper around many terminal types that, if the user didn't configured his/her own preference in the environment variable $TERMINAL, will try to load one of them following a very subjective order (and as Stapelberg says "Please don’t complain about the order").

Another very useful shortcut to get started is Win+d which will open a menu for launching your applications.
For me these 2 shortcut where more than enough to get started, if you are interested in the default shortcut map you may find this reference card very useful.

Configuration

As I've already said, the i3's documentation is excellent, and the configuration section is the main section. I also found very useful to take inspiration from other user's config on github. After many hours of reading, googling and trying this is my very own configuration:

https://github.com/giacomos/i3wm-config

Here some note about that:

  • after a while I split the config for my work laptop and personal one. I use symlinks for selecting the right config
  • I used i3status in the start, but then I decided that I wanted something more and I switched to conky. You can find my conky config in the same repo and conky is already set up as default status bar in my i3 config
  • the i3exit script (used for logging out, rebooting, locking and screen, etc.) is distribution dependent, it works on my ubuntu machine but not on my arch one. Will try to find a common approach for that.

The end

Since an image worth more than thousand words, here a screencast that will give you a taste of i3:

Since I discovered this totally new approach for using my workspace (at least for me) I knew I wanted to write a blogpost on that, and since then I also knew that the result would have been not that much "convincing". No shimmering screen shots, no fancy effects. Indeed it's a system that it's not exactly "cool" in the usual way. But "in the end it doesn't even matter" (cit. Linkin Park), if you're a "shiny MacBook" kind of person you'll hate i3 and all tiling wms anyway (but I guess none of those will reach this point, they would probably (rage)quit on the 2nd sentence... and this is good so this won't start a flame :p). BUT... but.. if you are the right kind of user/developer which prefers the substance instead of the appearance and you'll give it a try, I'm pretty sure you'll be amazed.

comments powered by Disqus