[xmonad] register XMonad as window manager with X

Jochen Keil jochen.keil at gmail.com
Sat Nov 5 23:44:07 CET 2011


Hello,

I have switched from gnome to xfce and came across some issues with xfce
+ xmonad. One more prominent issue was that xfce4-panel checks if a
window manager is running. It does so by looking through all atoms with
XGetSelectionOwner().
However, XMonad does not set a window manager atom using
XSetSelectionOwner(). Therefore it takes some time until xfce4-panel
times out and finally starts up.

To overcome this situation I took some code from XMonad's Main.hsc and
wrote a function to register XMonad with an atom.

registerXMonad :: X ()
registerXMonad = do
    dpy <- asks display
    root <- asks theRoot
    wmSnAtom <- io $ internAtom dpy ("WM_S" ++ show (defaultScreen dpy))
False
    io $ xSetSelectionOwner dpy wmSnAtom root currentTime

Currently I'm running this from the startupHook, but I think this would
be more appropriate in XMonad's Main.

Best Regards,

Jochen



More information about the xmonad mailing list