Xmonad and Gnome 3

The upgrade to Gnome3 in ArchLinux a few days ago broke my previous setup that combined xmonad with Gnome. Gnome 3 has a fallback mode, but I found that the instructions for replacing metacity under Gnome 2 no longer worked. With some help from the xmonad mailing list (in particular Jens Petersen and his efforts of providing a working setup on Fedora) I now finally have a working setup again. Here’s how I did it.

Add a session file for use by Gnome Session (/usr/share/gnome-session/sessions/xmonad.session):

[GNOME Session]
Name=Xmonad session
RequiredComponents=gnome-panel;gnome-settings-daemon;
RequiredProviders=windowmanager;notifications;
DefaultProvider-windowmanager=xmonad
DefaultProvider-notifications=notification-daemon

And a desktop file for GDM (/usr/share/xsessions/xmonad-gnome-session.desktop):

[Desktop Entry]
Name=Xmonad GNOME
Comment=Tiling window manager
TryExec=/usr/bin/gnome-session
Exec=gnome-session --session=xmonad
Type=XSession

That’s all it takes. Of course I’ve raised a ticket against the Arch package.

12 Comments

  1. Jacob says:

    Hey Magnus

    Had the same problem. Thanks for sharing the fix! :)

  2. dixie says:

    thanks!

  3. Thanks for notes I want to use Xmonad+Gnome3 on Pardus and I edit this changes on my system and on Login Screen I choose Xmonad+Gnome and I want to login but this message shown to screen.

    “failed to load xmonad session”

    How to solve this problem?

    Best Regars

  4. Bruno says:

    Hello, How does it render? Could you maybe share a screenshot?

    Thank you.

  5. Vladimir Gordeev says:

    “failed to load xmonad session”

    same problem.

  6. pconwell says:

    Ditto:

    failed to load session "xmonad"
    
  7. Magnus says:

    I’ve actually stopped using Xmonad since I wrote this. Soon after Gnome 3 was released I started looking around for alternatives to Gnome in the Gnome+Xmonad combo. Nothing seemed to really suit me though so I decided to give the Gnome Shell a serious chance instead. I’ve gotten to the point where it’s very usable and hence I don’t use the setup I describe in this post myself.

  8. emchristiansen says:

    Oddly, this worked on one of my Ubuntu 11.10 machines but not the other. The error I’m getting on the other is ‘Failed to load session “xmonad”‘, and I can’t figure out the difference between the machines.

  9. Alex says:

    I was having the [failed to load session "xmonad"] issue. I fixed it by running “sudo apt-get install gnome-panel” and modifying the xmonad.session file as follows:

    /usr/share/gnome-session/sessions/xmonad.session [GNOME Session] Name=Xmonad session RequiredComponents=gnome-panel;gnome-settings-daemon; RequiredProviders=windowmanager DefaultProvider-windowmanager=xmonad

    I tried using Gnome 3, but it’s a little clunky for my computer and xmonad makes using workspaces a zillion times more efficient.

  10. David says:

    I was getting failed to load session "xmonad" because I did not have the notification-daemon installed. To install the notification-daemon on Ubuntu 11.10 I used:

    sudo apt-get install notification-daemon
    
  11. Anshuman Bhaduri says:

    Like it says on the Xmonad GNOME wiki page, I also needed the applications/xmonad.desktop file. This made the failed to load session "xmonad" message disappear, however I’m still trying to get stuff to work just right.

    $ cat /usr/share/applications/xmonad.desktop
    [Desktop Entry]
    Type=Application
    Encoding=UTF-8
    Name=Xmonad
    Exec=xmonad
    NoDisplay=true
    X-GNOME-WMName=Xmonad
    X-GNOME-Autostart-Phase=WindowManager
    X-GNOME-Provides=windowmanager
    X-GNOME-Autostart-Notify=false
    
  12. Anshuman Bhaduri says:

    Ah yup, the Arch Linux wiki also states the same thing that I mentioned in my previous comment. Also, as mentioned in the Xmonad wiki, I had to have my ~/.xmonad/xmonad.hs config as

    import XMonad
    import XMonad.Config.Gnome
    
    main = xmonad gnomeConfig
    

    (this requires the xmonad-contrib package on Arch Linux). Now GNOME panel shows up just fine, along with a list of workspaces. I guess it shouldn’t be too hard from here.

Leave a Reply

Please use markdown to make your comment beautiful.