After 3 years, my xmonad configuration now uses GNOME

Nearly three years ago, Spencer Janssen and I started work on xmonad, a tiling window manager for unix that would do what we want, automatically, so we could just concentrate on hacking code, without the window manager getting in the way. The project’s been quite successful — the most downloaded app on Hackage for the last couple of years, and thousands of users. It even has its own twitter, blogreddit and facebook accounts.

Originally I thought of this project something as the anti-GNOME: small, learn, and every part just does one thing only, but well – in the Unix tradition. And it has stayed lean. Around two thousand lines of Haskell for the core system, but with the benefit of hundreds of extensions in the contributor’s library — everyone’s config file is potentially a library module new users can import.

Over the years, GNOME and xmonad have started playing well together to the point that there’s relatively seemless interop between the two projects: you can use the full GNOME environment, and swap in xmonad as your window manager, or use a minimal environment with xmonad, adding in GNOME tools that help you.

Playing well with others is good for your open source software.

I’ve now finally switched my xmonad configuration to use a number of gnome apps, to support the core dynamic tiling provided by xmonad. Here’s my config file:

import XMonad
import XMonad.Config.Gnome
import XMonad.Layout.NoBorders
main = xmonad
    gnomeConfig {
            terminal = "term"
          , layoutHook  = smartBorders (layoutHook gnomeConfig)
    }

Yeah, that’s it. import XMonad.Config.Gnome, add smart borders, and overide the terminal to be my urxvt wrapper. xmonad is configured in Haskell, or languages Haskell can interoperate with.

My session is started up from .xinitrc as:

gitit &
gnome-panel &
gnome-power-manager &
dbus-launch --exit-with-session xmonad

I use gitit as my personal wiki, and then put a few things in the gnome-panel.

I’m really happy with how easy it now is to use xmonad with all the regular GNOME apps that people would like to see. This kind of friendliness to the dominate tools of the day is good for the project — and good for our users.

5 thoughts on “After 3 years, my xmonad configuration now uses GNOME

  1. I’ve always used (only) the following with gnome:

    export WINDOW_MANAGER=/home/joe/.cabal/bin/xmonad
    export PATH=”/home/joe/.cabal/bin:$PATH”

    What does the gnome config add?

  2. Remember Hackathon 2007 in Freibug, where I wrote the EWMH module as basically my first action in the Haskell Community. It is always nice to see ones code in use, especially by the original authors of the software one contributes to!

  3. Hi dons,

    nice to hear about your xmonad ‘refactoring’.

    However, I wonder what will happen with xmonad+gnome combo after gnome-3.0 release which will be more hostile to WMs?

    Sincerely,
    Gour

  4. I’ve tried using something similar to your setup (but using an xmonad.start file instead of .xinitrc) but I can’t get logout to work. I think gnomeConfig binds Mod-Q to spawn “gnome-session-save –kill” and seeing I don’t have gnome-session running, this command fails. How do you get around this?

    Thanks
    Chris.

  5. Hey Don,

    I have been using XMonad for about a year, but would not yet say that it is easy to configure nor that Xmonad works well with Gnome. Perhaps my my hacks and work-arounds over the years have blinded me by the new simplicity, but please show me the light! :)

    I’ve documented each installation of Xmonad on Ubuntu 09.10, 10.04, with dozens of confirmed success stories:

    http://genaud.net/2010/04/xmonad-on-karmic-koala/
    http://genaud.net/2010/05/xmonad-on-lucid-lynx/

    Following the same directions for 10.10, I experience a number of issues that prevent me from extolling Xmonad to mainstream Gnome friends: seahorse, logout, panels hidden behind windows.

    I would love to see a step-by-step Xmonad installation/configuration tutorial on a freshly installed Ubuntu 10.10. This would do wonders for the Xmonad user base and in turn would give it upstream support in Ubuntu/Debian.

    Cheers,
    Alex

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 )

Facebook photo

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

Connecting to %s