Xmonad on Lucid Lynx
While Gnome on Lucid Lynx is pretty and Gnome has a bunch of features that make window management a bit nicer than before (like Win-w,e,s,n,m) I immediately longed for a decent tiling manager. So, within ten minutes and without further regret:
Get the latest xmonad packages
Unlike Karmic, Lucid repositories have the latest version of Xmonad (0.9).
$ sudo apt-get update
$ sudo apt-get install xmonad dwm-tools feh
Switch window manger
If you’ve installed vanilla Ubuntu 10.04, you’ll want to switch from gnome-wm to xmonad.
$ gconftool-2 -g /desktop/gnome/session/required_components/windowmanager
$ gconftool-2 -s /desktop/gnome/session/required_components/windowmanager xmonad --type string
Start xmonad from script
We’re changing one line of xmonad.desktop. Rather than start xmonad directly, we want to run the xmonad.start script.
$ sed s:^Exec=xmonad$:Exec=xmonad.start: /usr/share/xsessions/xmonad.desktop > ~/tmp.xmonad
$ sudo mv ~/tmp.xmonad /usr/share/xsessions/xmonad.desktop
$ sudo wget http://genaud.net/alex/2010/04/xmonad_files/xmonad.start -O /usr/local/bin/xmonad.start
$ sudo chmod +x /usr/local/bin/xmonad.start
Configure your own xmonad session
Note, you’ll need to type colon-quit (:quit) to exit the haskell compiler (ghci). Hopefully all modules load OK.
$ mkdir ~/.xmonad
$ wget http://genaud.net/alex/2010/05/xmonad.hs -O ~/.xmonad/xmonad.hs
$ ghci ~/.xmonad/xmonad.hs
Configure xmobar
Xmobar is activated from Win-p. Just start typing the first few characters of the command you want and hit enter.
$ wget http://genaud.net/alex/2010/04/xmonad_files/.xmobarrc -O ~/.xmobarrc
Finishing touches
Remove all the panel clutter and add pretty background image.
- Delete the bottom panel ( Right click > Delete This Panel )
- Autohide top panel ( Right click > Properties > Autohide )
- Set a desktop image by uncommenting and modifying the “
feh --bg-scale” line of/usr/local/bin/xmonad.start
Log in to xmonad session
The moment of truth… (oh wait, if you’ve never used xmonad before, take a look at the next section before it’s too late).
- Log out
- Click on your user
- Select Sessions:xmonad (from the bottom, was GNOME)
- Type password and Log In
Five important commands
There are more than a dozen commands. But that’s it. The steep learning curve immediately plateaus. Print a cheat sheet and you’ll be a tiling window master in no time. Here are perhaps the most important commands:
- Win-Shift-Return – to open a terminal window
- Win-Space – toggle between three columns, two columns, two rows, and full screen
- Win-Return – make selected window the master window
- Win-h – shrink master window
- Win-l – expand master window
Some more commands
- Win-Shift-c – close selected window
- Win-1 (or 2,3,4,5,6,7,8,9) – switch workspace
- Win-Shift-1 (or 2,3,4,5,6,7,8,9) – switch selected window to another workspace
- Win-j (or Win-Tab) – select next window
- Win-k (or Win-Shift-Tab) – select previous window
- Win-Shift-j – switch selected window with next window
- Win-Shift-k – switch selected window with previous window
- Win-, – add another window to master area
- Win-. – remove a window to master area
- Win-p – start typing a program name, say “nau” for “nautilus”
- Win-q – restart xmonad (useful after modifying xmonad.hs config)
- Win-Shift-q – quit xmonad (quick way to log out)
If you Win-(left-mouse drag) you’ll pop (un-tile) a floating window. You can Win-(right-mouse drag) to change the size and Win-t to set the window back into the tile layout. Some people like this and claim it makes working with Gimp or other dialog boxes easier. At least one person disagrees.
In the animated sequence below, we have three windows. The spreadsheet (white) is the master along with two terminals. The animation demonstrates toggling between two full screen windows, then cycling through four layouts from full screen, three column, two column, two rows, and back to full screen. From the keyboard that would be: Win-j, Win-k, Win-Space, Win-Space, Win-Space, Win-Space, ad nauseum.

Comments
Excellent step-by-step to replace the default wm on lucid lynx with xmonad. Thanks a bunch for providing this!
http://code.google.com/p/xmonad/issues/detail?id=168
how did you managed to avoid this issue with autohiding panel?
Hey Jack, When I installed XMonad along with Lucid Lynx (as above) all worked beautifully. However, at some point this summer (presumably after an update) there began two ‘features’. They are likely related.
(1) The top menu bar did not expand as described in the bug report (though if the menu is memoried, it is possible to select items from the menu on the zeroth/first pixel).
(2) A blank area (only on the bottom) where the bottom panel would have been. I can not expand (even single window full screen) to fill this small space.
Just curious, but how did you find out which commands to issue in that xmonad.start script? was it copied from a similar script which ubuntu uses to start gnome with compiz?
I ask because I upgraded to 10.10 now and wonder if this has gotten stale
Hi Matthew,
I have not upgraded to 10.10 yet. I discussed my sources for 9.10, but have tweaked the config files quite a bit. Compiz is installed, but I don’t really use it.
Cheers,
Alex
http://genaud.net/2010/04/xmonad-on-karmic-koala/
http://www.haskell.org/pipermail/xmonad/2009-November/009060.html
http://haskell.org/haskellwiki/Xmonad/Using_xmonad_in_Gnome
http://arjuna.deltoso.net/articles/my-configuration-of-xmonad-window-manager-with-xmobar-and-trayer/
http://jjinux.blogspot.com/2009/11/linux-my-xmonad-setup.html
I set Xmonad up on 10.10 according to this tutorial and it is sweet using it again after many years away from it.
However tasks that need admin privileges, such as software updates and gnome admin panels, don’t seem to ask me for password. Had any problems like that?
Hey Jon Gretar,
You’re right! I openned GParted and ran Update Manager without gsudo. Clicking on the ‘[Lock] Click to make changes’ icon of the Date and Time panel does nothing. I can’t ‘Add’ a user. And I’ve noticed that I can’t lock a screen with the screensaver.
I’ve simplified my /usr/loca/bin/xmonad.start file:
#!/bin/dash
gnome-settings-daemon
/usr/lib/gnome-session/helpers/gnome-settings-deamon-helper
gnome-panel &
gnome-screensaver
feh –bg-scale ${HOME}/background.png &
# bluetooth-applet &
sh -c ‘test -e /var/cache/jockey/check || exec jockey-gtk –check 60′ &
nm-applet –sm-disable &
gnome-power-manager &
update-notifier –startup-delay=60 &
dbus-launch –exit-with-session xmonad