Skip to content

Instantly share code, notes, and snippets.

@Tarrasch
Last active September 12, 2016 18:14
Show Gist options
  • Save Tarrasch/3156991 to your computer and use it in GitHub Desktop.
Save Tarrasch/3156991 to your computer and use it in GitHub Desktop.
Unity plus xmonad configuration (Ubuntu 12.04)

What

This is my xmonad+unity panel config. With this config, you'll have a well integrated panel from unity but still have xmonad as your window manager with your gnome apps, including the pretty gnome-terminal (for those too lazy to learn xmoobar).

This config doesn't have the unity launcher, mainly becuse it causes windows to be unfloatable, besides I'm not fond of it anymore.

How

Copy and paste these lines (or understand what it does and do it manually).

sudo echo "We do this so subsequent sudos don't ask for password"
GISTDIR='https://gist.githubusercontent.com/Tarrasch/3156991/raw'
mv ~/.xinitrc{,.backup}
curl "$GISTDIR/xinitrc"              |      tee ~/.xinitrc
curl "$GISTDIR/xmonad.session"       | sudo tee /usr/share/gnome-session/sessions/xmonad.session
curl "$GISTDIR/gnome-xmonad.desktop" | sudo tee /usr/share/xsessions/gnome-xmonad.desktop

Then log out and choose the custom login session (not the xmonad one, we want it to read from the .xinitrc)

Thanks to

Others gisters who basically did what I did, but I created a nice readme.

[Desktop Entry]
Name=GNOME with Xmonad
Comment=A GNOME fallback mode session using xmonad as the window manager.
Exec=gnome-session-xmonad
TryExec=gnome-session
Icon=
Type=Application
#! /bin/sh
exec gnome-session --session xmonad "$@"
[GNOME Session]
Name=Xmonad/Unity
RequiredComponents=gnome-settings-daemon;
RequiredProviders=windowmanager;panel;
DefaultProvider-windowmanager=xmonad
DefaultProvider-panel=unity-2d-panel
@osteotek
Copy link

small mistake: you use "gnome-xmonad.desktop" in the script, but your file actually called "gnome-monad.desktop"... Otherwise, everything working great, thanks!

@Tarrasch
Copy link
Author

Thanks @osteotek! I fixed that now. Also, I'm glad you liked the script! :)

@maertsen
Copy link

maertsen commented Oct 5, 2012

For users of 12.10: it seems that unity-2d does no longer exist. This causes an error on login (due to missing unity-2d-panel).

I solved this by switching over to gnome-fallback-session (apt-get install gnome-fallback-session) and changing the DefaultProvider-panel to gnome-panel (in xmonad.session).

To retake vertical space you can optionally use the global menu bar (apt-get install indicator-applet-appmenu), then while holding super+alt right-click on the menu bar to add a applet to the panel, choosing 'indicator applet appmenu'. You can remove the bottom panel using the same trick (holding alt+super and right-clicking on the bottom panel, then choose remove).

@sheldond
Copy link

Glad to see I'm not alone with xmonad+ubuntu! I'm trying to get your solution for 12.10 working, however, whenever I login I just see the ubuntu wallpaper (and I can't even start a terminal with alt-shift-enter). I'm testing this in a fresh install in virtualbox. I'm wondering if you have any more detailed instructions? Thanks

@sheldond
Copy link

Okay, my problem was not having xmonad setup with gnome config, e.g.: http://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_in_Gnome#Ubuntu_Precise

I'm now using Lubuntu (trying to go lightweight as possible) with xmonad and gnome-panel (so I can use global menu, which I couldn't get working in lxpanel or xfce's panel).

@Tarrasch
Copy link
Author

@sheldond, I don't think this will ever work for 12.10 as unity-2d (and in particular unity-2d-panel) doesn't exist for it. This was a conscious decision from Canonical. I think the idea was that they'll make the "3d" version even more lightweight and there is no need for a lightweight 2d version. Unfortunately for us, unity-3d is a window manager which means xmonad will never be able to coexist with it.

It seems however that you're okay with a non-unity solution. If somebody is willing to create/dig up a gist like this but for 12.10, please let me know (and use @ on me) so I can update this gist with a link to it. The reason why I haven't done it myself so far is simply because I'm still using 12.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment