I am using left Alt as my primary modkey, but for certain application I would like to use Alt+keys as my bindings, and for that specific application I want left winkey to be my modkey.
It seems that logHook is the right place to plug this logic in, but I have troubles understanding, how to do it.
Greatly simplified, my configuration looks like
import qualified XMonad.StackSet as W
import XMonad
import XMonad.Hooks.DynamicLog
main = do
-- some stuff
xmonad $ defaultConfig {
modMask = mod1Mask -- left winkey = mod4Mask, left alt = mod1Mask
, logHook = do
dynamicLogWithPP pp
}
where
pp = dzenPP {
-- more stuff
}
I could getName of current window in my logHook
winset <- gets windowset
let wname = fmap getName (W.peek winset) -- here I have some window identificator in Maybe
but I do not understand how to replace modMask in my main function, in defaultConfig, on the fly.
I would also be happy if on one workspace modkey will be different. Say, on workspaces 1 to 8 it is an Alt key, and on 9th it's left Winkey. This would do fine too, and I bet such solution can be easily modified to be based on currently focused window.