[Xmonad] Howtos wanted: Configuring xmonad with display managers

Andy Gimblett A.M.Gimblett at swansea.ac.uk
Mon Jun 4 06:55:48 EDT 2007


I'm running xmonad under FreeBSD 6.1 and Ubuntu Fiesty, both using
gdm, from ~/.xsession.  I'm not using any Ubuntu magic to add a new
display manager menu item - I hacked this mechanism together back when
FreeBSD was all I used (ie until about a month ago).

The relevant part of ~/.xsession looks something like:

--

dzstatus &

while true ; do
  PICK=$(gmessage -buttons _Xmonad,_Ice,"GTK_STOCK_QUIT" -default _Xmonad -center -print "Window Manager?")
  case $PICK in
      _Xmonad) /usr/local/bin/xmonad > /dev/null 2>&1 ;;
      _Ice) /usr/bin/icewm ;;
      GTK_STOCK_QUIT) exit ;;
  esac
done

--

dzstatus is a shell script which just runs a (python) status-building
script and pipes it to a dzen2.  It's external to .xsession so I can
easily kill/restart my status bar when tweaking.

I'm using this while/gmessage mechanism for a couple of reasons.
First, it's sometimes nice to have a choice of window manager, though
I don't use anything other than xmonad these days of course.

Second, and mainly, it allows me to exit xmonad without ending the X
session, so I can restart xmonad after a rebuild.  The mod-q restart
mechanism doesn't work for me because if I try to install a new xmonad
while the old one is running, I get:

[gimbo at orb xmonad] sudo runghc Setup install
Installing: /usr/local/lib/xmonad-0.2/ghc-6.6 & /usr/local/bin xmonad-0.2...
*** Exception: /usr/local/bin/xmonad: copyFile: resource busy (Text file busy)

No-one else seems to mention this?  At first I thought it was a
FreeBSD-ism, but I get the same under Ubuntu.  Any thoughts?

(Related: I have to manually chmod a+rx /usr/local/bin/xmonad after
every install, which is annoying.)

-Andy

-- 
Andy Gimblett
Computer Science Department
University of Wales Swansea
http://www.cs.swan.ac.uk/~csandy/


More information about the Xmonad mailing list