xmonad – a minimal window manager in Haskell

Wow, synchronicity. Yesterday I was browsing dons‘ space (because I spotted something like my string split in his h4sh stuff), and was very intruiged to spot xmonad. It’s another lightweight tiling window manager in the style of ion, wmii, dwm, and appears to be most like dwm in fact. It’s written in Haskell. Today, they announced the 0.1 release, so I just had to take a look.

It wasn’t too hard to install… A few dependencies, but all handled by Cabal, tvm. Since I already use wmii I didn’t find the keybindings too alien, and of course I can configure them at leisure should I wish to (and unlike dwm, it apparently doesn’t need a recompile when the config changes). Its (dwm-like) style of window management doesn’t sit completely easily with me, I have to say. I guess I’ve got used to the wmii way. I’m going to give it a go for a while, though, as I have an inkling I could grow to love it. It’s very snappy.

I miss three things.

First, a statusbar visible on every workspace. I just want to be able to see some things at a glance, always. Examples: time/date; battery life and charging/discharging status; xmms time remaining and shuffle status. Looking at the mailing list archives, it smells like there is or will be room for user-supplied extensions, and I guess this is an obvious candidate. If I don’t write it I’m sure someone else will. :-) Related to this is the ability to name workspaces, so they’re not just 1-9 – not critical but very handy. I don’t care about the whole tagging thing wmii does – I just want named workspaces as an aide memoir in the statusbar. “Ah yes, workspace 6 is hets.” That kind of thing.

Second, and routable-around: floating/unmanaged workspaces. Tiling/management is great 95% of the time, but sometimes it’s just a pain. The Gimp is the main culprit here, with its myriad windows of joy, but there are other cases. Xnest is probably the answer here. Here’s a little script to run an embedded icewm session:

#!/bin/sh

Xnest :1 -name "Xnest" +kb -ac -geometry 1280x800 &
DISPLAY=:1
xsetroot -display :1 -solid black &
exec icewm

Third, I miss my window bars (the bits along the top where most wms put close buttons, etc.). Primarily I miss them in my terminals, where they report the full path of the current working directory. Another handy at-a-glance feature. I guess I can live without this though, for the sake of precious screen space. :-)

None of these are killers/blockers, though, so I’m definitely going to give xmonad a serious go.

wmii FreeBSD and xmms plugins (in ruby)

A few days ago I started using wmii, with Mauricio Fernandez’ ruby scripting magic, and oh it’s fun.

The status bar monitors that come in Mauricio’s code don’t work for me, however, because I’m running FreeBSD not Linux, and things like uptime and battery status get report differently. Also, there wasn’t any xmms control/monitoring. I have now fixed both of these problems, and invite others to partake of the goodness.

So: wmii-freebsd@gimbo.org.uk.rb – a ruby/wmii plugin defining status bar monitors which work under FreeBSD.

And: wmii-xmms@gimbo.org.uk.rb – a ruby/wmii plugin defining an xmms status bar monitor, and some key bindings for simple control of xmms (play/pause; next; previous; forward 5 secs; back 5 secs; toggle shuffle; er, that’s it).

Status bar screenshot:

ruby wmii freebsd/xmms status bar monitors

From left to right: xmms monitor displaying track name, time elapsed, shuffle status (“>” is normal, “@” is shuffle); current master volume; the “-N-” is a standard plugin so I say nothing here; temperature and CPU speed; load averages; uptime (h:mm); battery status and time remaining; date/time.

Comments, suggestions, bugfixes, criticisms of my appalling ruby code all welcome.

wmii is better than ion

In August 2002, I started using ion as my window manager (and last year, upgraded to ion3). Today, I stopped using it.

ion beats the crap out of conventional window managers: placing and resizing windows is so tedious (not to mention 20th century ;-) ). It’s lightweight, maximises screen real estate, and has great keyboard support, all of which appeal to me. Until today, I’d have recommended it to anybody.

I did, however, have the following problems with ion: 1) Lua: yick and oh my god, yuck. What an awful language, but you’re stuck with it for configuration/control. 2) The documentation: there, but not very helpful. Too referencey, too automatically produced. 3) Tuomo (the author): sorry, but that is one surly gringo, and heaven help you if you disagree with him. None of these are killers (except maybe lua), but they’re the reasons I’m happy to leave ion behind.

Thus, introducing wmii, which is superficially similar to ion but has a number of features which really set it apart. The most important is its Plan9-inspired approach to control, which allows any language for configuration. You know what’s coming next? Ah yes, we can configure & control wmii using ruby [via the immortal _why].

There are other good reasons to use wmii, but that one is probably sufficient for me – and it speaks of a thoughtful and open design which can only bode well. The wmii codebase really is tiny, by the way – it compiled in no time at all. I started using it this afternoon and I don’t see any reason to stop: it’s easy enough to pick up, although I’ll be tweaking the config for the next week or so. Using Ruby – w00t!