[xmonad] Deactivate hotkeys

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


Hey,

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 
this:

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. 
(http://www.haskell.org/pipermail/xmonad/2008-July/006063.html)
It seems, it never made it into xmonad, although this might be the best 
solution.

Thanks,
Stephan




More information about the xmonad mailing list