Home > Haskell > XMonad: A tiling window manager written in Haskell

XMonad: A tiling window manager written in Haskell

February 8th, 2009

For a very long time I have been floating back and forth between a handfull of windows managers trying to find something that I like and doesn’t get in my way.  The one I have always gravitated to is Window Maker, simply because it is minimal and has a ridiculously small footprint.  I’ve also used Gnome and KDE from time to time but they just try to do too much and I need something that will support my terminal driven usage habbits.

Since I’ve been doing a lot of functional programming lately, a lot of which being in Haskell, I thought it was time to re-evaluate my window manager situation.  This is where xmonad comes in.

To be honest, I’ve never given much though to tiling window managers and I’m not sure why.  I’ve been using xmonad for the last 6 months and it is simply beautiful.  It can be driven entirely from the keyboard with some dead simple keybindings that are customizable.  I found myself changing the meta key used in most keybindings to the silly windows key on the keyboard… for a long time this key was worthless to me but xmonad likes to use Alt by default for most commands which conflicts with Emacs in some situations.  Configuration can be a little difficult for anyone who is not familiar with Haskell but there are plenty of examples and the code itself doesn’t require any advanced programming skill.

Another thing that impresses me is how well it handles multiple displays and multiple desktops.  Each screen’s desktop is capable of displaying any one of my 10 virtual desktops and they can be selected independently.  This may seem very rudimentary but the way that xmonad handles this is very elegant.  Per-desktop layouts are also excellent, and it’s a quick keystroke to switch between layouts.

It almost goes without saying that the aim of the project is to provide a crash free experience and I can back this up.  Since I have been using it it has crashed exactly zero times.  It also has a massive extension library that includes dozens of layouts, support for docks, panels, prompts and more.   It even has extensions to use it with Gnome and KDE.

The only problem I could imagine someone having is in writing a configuration file.  Luckily there is an archive of user submitted configuration files demonstrating pretty much everything that it can possibly do.  As is the case for the Haskell community in general there is also a wonderful user base to support it and any one who wants to use it.

mat Haskell ,

  1. gwern
    February 8th, 2009 at 11:43 | #1
  2. sereven
    February 8th, 2009 at 11:50 | #2

    Looks like the link to the xmonad config archive is broken. http://haskell.org/haskellwiki/Xmonad/Config_archive is the correct link. And there’s a reasonably useful bunch of tips plus information about changes since version 0.8.1, too, on plain old http://haskell.org/haskellwiki/Xmonad.

  3. assd
    February 8th, 2009 at 13:36 | #3

    It’s ugly. I, personally, can’t work on my computer if I don’t like the look. Best wishes.

  4. Paul
    February 8th, 2009 at 13:43 | #4

    I disagree, it is minimalistic and nice. I like that it is usable without a mouse too, as is fluxbox.

  5. kyber
    February 8th, 2009 at 14:08 | #5

    How can it be ugly? There’s almost nothing to see.

  6. Vlad
    February 8th, 2009 at 14:23 | #6

    It’s not ugly; it has so few things (window bars and buttons) that it can’t be ugly. Now, three different colors to display a single window’s decorations — that’s ugly.

  7. mat
    February 8th, 2009 at 16:18 | #7

    Sorry for the broken link to the configuration pages… it’s fixed now.

    I suppose each person has to make their own decision about what window manager fits best. Honestly, to me, it’s not ugly. I’ve read a lot of stories where reviewers went back to using old window managers because they didn’t like the tiling aspect of it. I found myself wondering why it took me so many years to discover this type of window manager and after using several of them I like this one the best.

    xmonad is also extremely well written, and I have to give credit where credit is due. As a programmer I’m just naturally drawn to good code.

  8. mat
    February 8th, 2009 at 21:32 | #8

    I should note that I’m currently using xmonad 0.8.1 on OpenBSD 4.4 using a GHC snapshot: 6.11.20081122

    OpenBSD ports can lag behind a little but building these took very little effort.

  9. February 9th, 2009 at 12:58 | #9

    How did you get the layout of desk1.png image?

  10. mat
    February 9th, 2009 at 13:19 | #10

    It’s the Circle layout which is included in xmonad contrib. There is some helpful info in the docs on how to use it with your xmonad.hs:

    http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-Circle.html

  11. Julian
    February 9th, 2009 at 14:03 | #11

    I’ve heard of xmonad and I tihnk I’ll give it a try. I like Window Maker – it’s fast, simple and effective.

    I’m learning Haskell at the moment as well (trying to, anyway), so why not!

  12. nimred
    May 31st, 2009 at 02:29 | #12

    how did you get GHC 6.11 working on OpenBSD 4.4 ?

  13. mat
    June 2nd, 2009 at 09:10 | #13

    @nimred
    That wasn’t as bad as I thought it was going to be. The main thing is that you need GHC in order to build GHC… so I installed the older GHC from ports and used that to bootstrap the Darcs repo.

  14. September 20th, 2009 at 17:53 | #14

    I recently switched to xmonad myself (http://jeremy.zawodny.com/blog/archives/011331.html) and would love to make the Windows key into the meta key for xmonad so that it doesn’t get in the way emacs.

    How’d you do that?

    Thanks!

  15. mat
    September 24th, 2009 at 13:45 | #15

    @Jeremy Zawodny
    It’s pretty simple actually just set the ‘modMask’ property to mod4Mask… here’s the relevant section from my config:

    xmonad $ matUrgencyHook $ defaultConfig {
    manageHook = …
    layoutHook = …
    modMask = mod4Mask,

    }

  1. No trackbacks yet.