[xmonad] Deactivate hotkeys

Stephan Rave lists at stephanrave.de
Wed Dec 8 01:20:33 CET 2010


I would like to be able to dynamically deactivate some of xmonad's hotkeys.

Since keybindings are immutable, I tried to write an action which passes the 
key to the focused window if the hotkey is disabled. The best I could do is 

myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
	(  (controlMask       , xK_o     ),  foo  )

foo = do
    -- check if the hotkey is disabled. If yes, do:
    XConf { display = dpy, theRoot = rootw } <- ask
    io $ ungrabKey dpy anyKey anyModifier rootw
    spawn "xdotool key o"

This more or less works for firefox, except that when I switch to my firefox-
workspace, I first have to click into the window. In KDE applications like 
kmail this does work at all. Any ideas, why?

There was once a patch which tried to solve the problem by moving 
keyActions to XState. 
It seems, it never made it into xmonad, although this might be the best 


More information about the xmonad mailing list