Saturday, November 24, 2012

i3 my new WM of choice (so far)

I've been a relatively content user of KDE and XFCE for a while. Before that I'd used FVWM and AfterStep pretty extensively in addition to TWM, VUE, and MWM. A few years back (late '07) I had become obsessed with Lua as a programming language when I was trying to do somethings that AWK couldn't handle elegantly and for which other languages (Python, Ruby, Perl, etc) were just too big. Shortly thereafter I came across Awesome, a window manager that's tiny (originally a fork of DWM) and extensible through Lua. I have a friend who's all about his Haskell and is an ardent fan of xmonad. I never understood his zealotry until I'd found Awesome.

Honeymoon is over

Some time later (by mid 2010) I was working mostly from my Macbook Pro with only 4GB of RAM and I'd stopped using Awesome all together. All of my customizations were off in some back up somewhere on one of my file servers and I was focused on being productive with whatever UI constraints came with OS X (mostly).

The 7 year 24 month itch

The efficiency and elegance of a minimalistic tiled interface kept calling to me. I tried various 'tiled window managers' that sit on top of OS X and none of them really clicked for me (no pun intended). Most of them just added bloat to Aqua and didn't really bring to it the simplicity I'd enjoyed with Awesome. For a while (with Snow Leopard), I ran in an X only configuration. I couldn't get all of my Awesome configs to work the way they had been working previously (on FreeBSD) so I abandoned that effort and loaded up KDE. KDE was enough like Aqua that it's differences presented a problem for me. I'd been a long time KDE user, but had most recently used Aqua exclusively and on my Mac(s) in KDE my mind thought of only Aqua key bindings. I spent some time remapping keys and then gave up. Back to Aqua I went.

It's not you it's me

Sick of the poor memory performance I get on my Mac(s) with 8GB of RAM I decided to move most of my daily administration, systems engineering, and web development to another platform. I can do all of those things and more on a FreeBSD box with 4 GB and have no problems whatsoever. It just so happens that I have a 24GB quad core rig laying around begging to be put to use so I decided to use that instead.

With all of those resources I decided to run KDE with every option turned to maximum bloat. The performance was great. Unfortunately, KDE just doesn't seem to be my thing anymore. Just recently I was having a conversation with a former WebKit developer wherein we discussed my affinity for the KDE project. It pained me to realize that KDE and I just want different things.

Hot new thang

One day I'm digging around one of my boxes looking for my old Awesome configs and I decide to checkout DWM because a friend of mine has been tweaking the hell out of it himself for his own use. I came across a post on the Arch Wiki while doing a search for DWM configs and customizations which compared various tiling window managers. Much had changed in the world of tiling WMs since last I'd taken note. It was time to do some exploring. Anything built with Xlib was disqualified which meant DWM (the whole reason I'd come across this wiki page in the first place) was out. Being a big fan of python since 1999 I decided that Qtile must be investigated. First, though, I wanted to see just how extensible this i3 thing was. Obviously if you can't script it you don't have the power of something like Qtile, Ion, Awesome or xmonad. There was already a package for my BSD system so I installed it and off I was to play with a new toy.

Really pretty but a little annoying

I'd be lying if I told you that i3 is just as configurable as any of the other aforementioned window managers. With that said, i3 has a very basic and well thought out design that leverages existing system paradigms and mechanisms (sockets, pipes, etc) to achieve a level of configurability that goes deeper than most text based config systems.

I won't go into all of the details here but suffice it to say that I was very pleased with the system capabilities and immediately set about changing the defaults to suit my needs. By default ALT is used as a META/SUPER key; changed that do the "Windows Key". The docs talk about how they have vi-like key bindings. Unfortunately by default the keys are shifted by one to the right making h:j, j:k, k:l, and so forth. The reason for this was that META+h is used to indicate a horizontal split for a window container. META+v is used for Vertical. I changed it so that the '|' and '-' keys did horizontal and vertical splits respectively which freed up the h key to be used with the rest of the normal vi keys. I wanted an easy to switch between workspaces/tags so I mapped the brackets to switch the views and the braces to move active containers/windows from one view to another. Beyond the key mappings I replaced the status app (i3status) with my own i3status.awk script. I another script called mate.awk to persistently prevent my screensaver from kicking in when I don't want it to but also don't want to fully deactivate it. It's called mate (pronounced mah-teh) because it's similar in function to the program caffeine on OS X.

The full config is available on my fossil server. I tend to avoid using github but enough people expect stuff to be there that I reluctantly push things up from time to time. You may find it there if I get around to it.

In closing

i3 is a much more capable window manager than I'd suspected and suits novices and power users alike. I haven't yet gotten around to checking out Qtile because i3 is pretty nice. Whatever you can't get done with sockets, pipes, and I/O redirection you can achieve by hacking the source which is insanely well documented. My hat is off to the guys of the i3 project.


  1. I was undecided what tiling WM, but this article was vary fun and helps me to give a good idea. Thanks.

  2. Thanks Miguel, I appreciate the feedback.