16 lines
500 B
Haskell
16 lines
500 B
Haskell
|
module Utils ( mkSubmap ) where
|
||
|
|
||
|
import qualified Data.Map as M ( fromList )
|
||
|
|
||
|
import XMonad ( (.|.) )
|
||
|
import Graphics.X11.Types ( KeyMask , KeySym , ButtonMask )
|
||
|
|
||
|
import XMonad.Core ( X )
|
||
|
import XMonad.Actions.Submap ( submap )
|
||
|
|
||
|
mkSubmap :: ButtonMask -> [((KeyMask, KeySym), X ())] -> X ()
|
||
|
mkSubmap modm = submap . M.fromList . concatMap buildSubmaps
|
||
|
where
|
||
|
buildSubmaps x = map (buildSubmap x) [0,modm]
|
||
|
buildSubmap ((modKey,key),action) m = ((modKey .|. m,key),action)
|