Another Blog

Mostly about computers, generally Linux-related

Wow… xmonad does it again!

I’ve been happily using xmonad for a while now. It’s a tiling window manager written in Haskell. To me it’s a huge boost in productivity and it has helped me rediscover the fun of using a computer. Although I’ve initially tried it simply because it was written in Haskell (I was a happy wmii user then) , I now dread every single moment of using a different window manager.

Above all, xmonad is incredibly flexible. This comes from the huge extension library it has. It can tile windows in a myriad of ways, and even float them in unexpected manners. It has per-workspace configuration, so I can have 9 or more workspaces, each with different layout algorithms. I greatly appreciate a program which has allowed me thus far to go through 4 “patterns of usage”. To be more specific, I’ve gone through:

  • The “tall” default configuration. This keeps my “main” (master) window occupying 70% of the screen, and the other windows stacked to the right of the screen. The proportion occupied by the master is adjustable (see screenshot) and so is the number of masters. This is a lot more flexible than it sounds — I can have 4 equal xterms in a few keystrokes, by setting the number of masters to two and the split point at the half of the screen.
  • Three columns. I have tried this briefly for my widescreen laptop, before realising I rarely need to view 3 different source files at once. I’ve also realised I’m greedy with my non-xterm windows, so I prefer Firefox or Evolution to grab the entire width of my screen, which is what brought me to the next iteration.
  • Tabbed windows. I’ve whole-heartedly returned to my first tiling experience (with Ion3) and used Tall and Tabbed exclusively up till, well, today. The general pattern was to stuff a lot of related windows into a single tabbed workspace if I only needed to see one of them at a time. This worked wonders, but I’ve long wanted an extension to it, cue a few hours spent reading and tweaking today. I’m not delusional — I don’t consider my work so important and difficult that I needed to change the perfectly fine configuration I had; changing it was just a lot of fun. If I realise I’ve made a mistake, I’ll just use darcs to change back to my old config.
  • Tall-Tabbed Combo. Today I’ve added a new layout mode to my configuration, partly inspired by David Roundy’s sample. It splits the screen in two, similarly to Tall, and each half of the screen contains tabbed windows. This enables me, for example, to keep half a screen containing a few documents which I can cycle through, and the other half containing code which I clumsily write. I can easily move windows from one half to the other, bar a few hours of getting use to the commands. Of course, “half” is a generic term, since I can resize the two chunks to any proportion. This uses the excellent Layout.Combo and Layout.WindowNavigation extensions, in addition to Layout.Tabbed, Layout.NoBorders, and Layout.PerWorkspace, which I had previously been using.

So, to sum up another probably tl;dr post, xmonad rocks because:

  • I’m immensely productive with it.
  • It’s fun to both configure an use.
  • It’s alive. When I first started using xmonad (which was, mind you, not at its very beginning), many of the extensions I use or have used in the past didn’t even exist.

If you feel like giving it a try, be aware that you need some knowledge of Haskell if you want a custom configuration, but I’m more than happy to help with what limited knowledge I have. A much better place to go if you have a little background is #xmonad on FreeNode.

Advertisements

December 22, 2008 - Posted by | functional programming, haskell, linux, school

2 Comments »

  1. Nice! Would you care to share your configuration and the most used keyboard commands?

    I also really like that you have the Ubuntu menu bar at the top, how does one do that?

    Comment by Arnar Birgisson | December 22, 2008 | Reply

    • I’ve made my configuration available as a darcs repo here. You can use darcs or just download xmonad.hs via HTTP. It probably works only for version 0.8 of xmonad. You will also need xmonad-contrib, which is probably included in Ubuntu (I’m a Gentoo user, myself).

      The main keyboard commands I use are:

      Mod4+Enter – fire an xterm
      Mod4+p – launch a program
      Mod4+Ctrl+C – kill the currently focused window
      Mod4+Space – cycle through layouts
      Mod4+j/k – focus next/previous window
      Mod4+Ctrl+j/k – move window up/down
      Mod4+h/l – change Tall proportions
      Mod4+[1..9] – switch workspace
      Mod4+Ctrl+[1..9] – send current window to workspace
      Mod4+Left/Right – cycle workspaces
      Mod4+Up/Down – cycle through sublayouts — I added this one today
      Mod4+a – execute an “action”, similarly to wmii

      As for using xmonad with GNOME, i think you can find out more here. I don’t use a desktop environment, so I have no idea how well this works.

      Comment by Vlad Dogaru | December 22, 2008 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: