While the battle of Windows vs Mac rages, Linux geeks have their own holy war: GNOME vs KDE. Like many wars it started over he said/she said. While there were valid points, those points have been worn down with time to stubs that people shake at each other. Finally the war is over and I have a shot of the victor:
XMonad has defeated all other desktop environments (for me). Upon starting, XMonad presents a minimal UI - a black screen. XMonad is a tiling window manager, meaning as you start running applications it will create a grid of windows for you. You specify a layout and it moves the windows around for you, resizing them to fit.
Stop Pushing Pixels
A large screen allows more to be presented at once, but it requires more movement of the mouse as applications need more/less room. Even Fitts's law starts to breaks down when using 30" monitors. Moving thousands of pixels can require multiple movements, and returning to your previous location painful. Resolution increases makes window management via a mouse a losing battle.
XMonad solves this by allowing you to answer the question: how do you want your windows arranged? Then it moves them around for you. Switching layouts is fast, as is choosing which windows are important.

Currently my screen is divided into 6 boxes:
- MAIN 1 is a browser where I'm putting the final touches on this post.
- MAIN 2 is a browser with pages I am referencing.
- SUB 1 is emacs with my XMonad settings file.
- SUB 2 is a chat window.
- SUB 3 is a list of contacts
- SUB 4 is a terminal I used to captured this screenshot:
import -window root xmonad.png
Workflow
Switching to another program is done by hitting windows-j/k, which changes the focused program (it is highlighted with a 1px red border).
If a program in the SUB section needs more room, I hit windows-enter, which makes it switch places with the program in MAIN 1. Applications are resized to fit the existing layout.
Then if I really want to dive into something I can switch layouts using windows-spacebar. By switching to full screen layout, I am presented only one program at a time. By using windows-j/k I can switch between programs, each one remaining full screen. When I want to return to my previous layout I hit windows-space a few more times to return to my exact previous state.
In addition to great control over a single monitor, you have multiple virtual screens, each of which has its own layout and collection of windows. So your web development screen prioritizes your editor, your browser. Your social screen has many communication windows (twitter, gtalk, irc). Switching between virtual screens is done by pressing windows-1, windows-2, windows-3 and so on. In additional it supports multiple real screens.
Customization
XMonad by default uses ALT, which conflicts with many applications I use every day. In my settings file I change that to Mod4 (windows) and tweak the color and size of the borders. Lastly, I add a shortcut key to raise-or-run (windows-o for open).
XMonad is written in Haskell and uses haskell code for settings. It takes a while to figure out the syntax but there are many examples you can use to figure it out. Here is my current ~/.xmonad/xmonad.hs
module Main (main) where
import XMonad
import System.Exit
import qualified Data.Map as M
import Graphics.X11.Xlib
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.XMonad
import XMonad.Prompt.RunOrRaise
myModMask = mod4Mask -- "windows key"
myNormalBorderColor = "#000000"
myFocusedBorderColor = "#ff0000"
myBorderWidth = 1
main :: IO ()
main = xmonad $ defaultConfig {
normalBorderColor = myNormalBorderColor,
focusedBorderColor = myFocusedBorderColor,
keys = newKeys,
modMask = myModMask,
borderWidth = myBorderWidth
}
newKeys x = M.union (keys defaultConfig x) (M.fromList (myKeys x))
myKeys x =
[ ((modMask x, xK_o), runOrRaisePrompt defaultXPConfig) ]
If the features seem sparse, there are many extensions which add actions, layouts and hooks. After some experimentation I've decided to stick to the defaults. I can see them being useful, but the improvement is smaller than the initial jump caused by switching to XMonad.
Try it out
If you are a Linux user I urge you to try it out. If you do let me know how it goes and any tricks you learn .
