Custom xmonad Terminal Layout

December 14, 2009 by · 2 Comments 

My terminal layout

My terminal layout

I’ve been using xmonad as my window manager at work for a while now. xmonad is a minimal tiling window manager written in and configured using Haskell. The main stated advantage of using a tiling wm is that all your windows automatically expand to fill up your screen. What I like most about it is actually the ability to change workspaces (or virtual desktops) on each screen individually, without having to use separate X screens.

Previously, I had used xfce4 and compiz-fusion with all sorts of flashy eye candy, like the rotating cube. I wanted to be able to rotate each monitor separately, which was wasn’t possible if you had your desktop stretched across multiple monitors. You had to use separate X screens for each monitor, so windows had to stay on the monitor they were started on.

xmonad works exactly the way I want it to: I have one big desktop, I can move windows back and forth between monitors, and I can switch an entire workspace from one monitor to the other without having to do any kind of rearranging myself. Even if they use different resolutions. It’s a big step down in terms of eye-candy and ease of configuration, but a big step up in productivity and efficiency.

One thing that always bothered me is that I didn’t really use the tiling capabilities of xmonad at all. Most things I just use full screen: browser, email, editor, etc. I do use a handful of terminals, and those are usually what you see the most of in screenshots of tiling wms. Unfortunately, my screen is too wide for a single terminal but too narrow for two, so I just used a floating layout and manually scrambled them all over the place. There just isn’t a way to make tiling work for me without having terminals overlapping or squished.

I tried several layouts, but nothing really fit and I always ended up reverting to the pure floating layout. Eventually, I noticed a pattern in the way I was arranging my floating terminals. I’ve always been impressed with how simple and short most of the xmonad source code is, so I decided I’d just write my own layout and be done with it.

How hard could it be?

Read more