Double header

Quiet here lately because it’s exam processing time in the real world, so I’ve been busy busy busy marking, check-marking, and munging. Next week’s busy too but then I can settle into research gear for the summer and do lots of Haskell — woo.

I’m still loving the hell out of xmonad, which just keeps getting better every day. Yesterday I went dual head through the magic of Xinerama; at first it made my brain hurt, trying to keep track of where each workspace was, but now I’m getting to grips with it, I’d say. It’s nice to be able to work on one thing (a blog post, say) while keeping an eye on a background job, and while programming it’s cool to have multiple emacsen filling my field of vision. What could be better?

There is surely much more to say about many things, and I will surely say them soon.

Xmonad does status bars right by not doing them at all

The first thing I complained about the first time I saw Xmonad was the lack of a status bar. As Xmonad approaches its 0.2 release, it has become clear to me that this absence is in fact a feature, not a bug. Here’s why…

It’s now possible in Xmonad to define gaps on the edges of the screen, over which it will not arrange windows. This immediately and beautifully solves the status bar problem, because now you just run a separate status bar app, filling in whatever gap you’ve defined. If the app sets the “override-redirect” X flag (which anything claiming to be a status bar should), it’ll appear on every desktop and be excluded from Xmonad’s window management.

This is a stroke of genius, and a fine illustration of that principle at the beating heart of Unix, namely that you should write apps which do one thing well, and use them in synergetic combination. xmonad manages windows, but it is not in fact its job to provide a status bar: only the space for one. Factoring the status bar out in this manner gives us choice and orthogonality, both of which are A Good Thing.

For now, I’m going for the easy option: dzen, a minimal text-only status bar (looking a bit like this but at the bottom of the screen). Alternatives exist, for example the KDE kicker, but I haven’t really explored that space yet. In all honesty, I’ll probably just stick with dzen. What I want next: a way to display, on the status bar, info about which workspaces are in use, and which is visible. For this, Xmonad will need to report its current status somehow, perhaps like wmii does with its plan-9 inspired pseudo-filesystem.

Update 2007-06-15: very quickly, I got my wish; xmonad now has configurable logging hooks which can write arbitrary data to stdout every time the internal state changes — pipe that to dzen and hey pesto, problem solved. By default there’s a basic logger which simply writes a list of workspaces which currently have windows on, with the current workspace surrounded by square brackets. Lovely jubbly.

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.