Adventures with Xmonad

I switched back to GNU/Linux full-time (Ubuntu on ThinkPad x201) almost a year ago, but it was just this week that I found the will to meander away from the default Gnome 2 desktop and window manager.

In the world of X-windows, the way your desktop looks and behaves is controlled by an independent program called a window manager, and there are many such programs. I burned my way through several in the old days before Mac OS X. The first one I remember explicitly was twm, the default on our DEC Ultrix setup at the time.

A persistent, though minority, approach in some window managers has been tiling. This idea abandons the typical (and once revolutionary) desktop metaphor of overlapping windows, like pages on a desk. Instead, your windows fall into particular patterns called layouts, covering whatever screen space is available.

The upshot is that – in most cases, with many types of apps – you don't have to think much about moving and resizing windows to see what you want. You also use the mouse a lot less.

I tried a few tiling WMs over the years in my pre-Mac Linux days, but none ever stuck for more than a day. They were hard to configure and, at times, clunky and awkward to use. Recently, though, I had been hearing about Xmonad, a window manager written in and configurable with – get this – Haskell!

Having a full-blown programming language in which to configure things makes a huge difference. Previous WMs required heavily repetitive but unrefactorable configs. (I guess I'm lucky that I knew Haskell already – it can be somewhat impenetrable to the uninitiated.) What's really remarkable about writing your Xmonad config in Haskell is that it's a statically-typed, compiled language. Most configuration languages are dynamic, loosely-typed: Emacs Lisp, Guile, Lua. And yet Xmonad can reload your config at any time, seamlessly. (It's fast, and doesn't lose state.) Now I'm having fantasies that one day we could have an Emacs configured in Haskell. Blasphemy?

My Xmonad configuration is available on github if anyone is interested, along with other ‘dot files’. I did end up writing my own layout. I wanted one with a centered master window, big enough for 960-pixel web pages, and tiled windows along the side margins that the master actually overlaps. The side windows can be brought forward when focused, without having to swap them with master. It's kind of a mashup of the CenteredMaster and the Circle layouts in contrib.

If you'd like to explore tiling and can spend some time on configuration, I definitely recommend Xmonad!

©20022015 Christopher League