xmonad on Unity 12.04

I love the xmonad window manager. It's tiling, so it maximizes real estate, and it is driven by keys instead of the mouse. It's written in Haskell -- enough said.

However, much as I love to tinker, I am reluctant to give up some things that "just work" when running Gnome and its successor, Unity. So I run xmonad as the replacement window manager within Unity.

I recently had the privilege of obtaining a new Zareason UltraLap laptop (Zareason has an open bootloader, and ships with any of a variety of linuxes that also "just work"), and so I got to configure xmonad from scratch.

My modus operandus for this kind of thing is to see if someone else has solved it first, and my final (so-far) configuration came from merging a few sources.

First, I followed the advice of Elon Flegenheimer. Three of my config files came from him:


[Desktop Entry]


[GNOME Session]
Name=Xmonad Unity-2D Desktop


#! /bin/sh
exec gnome-session --session xmonad "$@"

Then I based my /home/amber/.xmonad/xmonad.hs on that of Arash Rouhani, but I changed the Unity panel option to "doFloat" instead of doIgnore:


import XMonad
import XMonad.Util.Run
import XMonad.Util.EZConfig (additionalKeys)
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ICCCMFocus
import XMonad.Config.Gnome

myManageHook = composeAll (
[ className =? "Unity-2d-panel" --> doFloat
, className =? "Unity-2d-launcher" --> doFloat

main =
xmonad $ gnomeConfig { modMask = mod4Mask
, manageHook = manageDocks myManageHook manageHook gnomeConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig
, logHook = takeTopFocus
} `additionalKeys` [ ((mod4Mask, xK_d), spawn "dmenu_run -b")
, ((mod4Mask, xK_Return), spawn "xfce4-terminal")

All the configurations I looked at had something in /usr/share/xsessions/xmonad-gnome-session.desktop, but my old laptop, on which I also run xmonad on Unity, does not, so I left that out.

Finally, there is a problem with application menus which I fixed per advice in that link by uninstalling indicator-appmenu.

This keymap chart shows most everything you need to know to get going with xmonad, and if you get stuck, try joining the irc channel #xmonad for help.


Comments powered by Disqus