I'd like to share how to configure Xmonad to fit nicely in Gnome (replacing metacity as the window manager) and, as a plus, to be able to use Gnome Do as a launcher as well.
This implies that you'll have the complete Gnome Desktop Environment (menus, taskbar, panels with clock, notification area, themes, fonts, wallpapers, etc) but with the advantage of having Xmonad as your window manager.
I attached some screenshots of how it looks.
Step 1: Installation
First of all, you'll need to have xmonad and xmonad-contrib packages installed:
- xmonad
- libghc6-xmonad-dev
- libghc6-xmonad-contrib-dev
If you are running Intrepid, all this packages are updated and work fine. If you are running Hardy, you'll have to include Intrepid main in your sources to access the updated libghc6-xmonad-contrib-dev package, which has the Gnome config file that allows Xmonad to play nicely with Gnome.
Edit your /etc/apt/sources.list and include the following line:
Code:
# Intrepid sources
deb http://archive.ubuntu.com/ubuntu intrepid main universe
Now update your sources file and install the xmonad and xmonad-contrib packages listed above. You can disable the Intrepid packages later if you do not need/want them.
You should now have xmonad installed. if you want to test it, you can log out of your session and log in again selecting xmonad in the GDM screen. You'll note that there are no panels, no background, etc. If you try to launch anything (alt+shift+enter launches a terminal, you can launch applications from there), the gtk theme won't be the one you probably have in gnome, etc. We'll have to tweak things a little to change all that.
Step 2: Replacing Metacity
To override metacity when logging in to gnome, create a file name .xsession in your home folder with the following content:
Code:
export WINDOW_MANAGER=xmonad
exec gnome-session --purge-delay=3000
Step 3: Tweaking Gnome Not necessary!
You'll have to disable the desktop (this means you'll have no desktop icons, wich don't make much sense with a twm anyway). Type this in the command prompt:
Code:
gconftool-2 --type boolean --set /apps/nautilus/preferences/show_desktop false
This step is not mandatory! You could do it anyway if you feel like it, but I found out that you can have your beloved desktop icons, it works anyway.
Step 4: Tweaking Xmonad
Create the directory .xmonad in your home folder, and the file xmonad.hs within it. Add the following lines:
Code:
import XMonad
import XMonad.Config.Gnome
main = xmonad gnomeConfig
Save it and restart the X session normally. That's it!
Step 5 (Optional): Further tweaking for Gnome Do
If you are a Gnome Do user (and you should be!), you'll notice that Xmonad tries to handle Do's window like a regular one, resizing it to full screen. The following xmonad.hs file make it ignore Do's existence:
Code:
import XMonad
import XMonad.Config.Gnome
import XMonad.ManageHook
myManageHook :: [ManageHook]
myManageHook =
[ resource =? "Do" --> doIgnore ]
main = xmonad gnomeConfig
{ manageHook = manageHook gnomeConfig <+> composeAll myManageHook }
That should do the trick. You can also edit that config file to further customize it (focused window border color, for instance). Check out the Xmonad page
I suggest you also add Vimperator to the mix (It's a Firefox addon that enables you to use vim-like keybindings for web browsing); you'll have a full-featured and keyboard driven working environment!
For a more comprehensive guide, visit the following page: http://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_in_Gnome
Bookmarks