Last active
September 27, 2017 09:56
-
-
Save lisael/47e6d637de6fb94365d9f1ef8f0ba646 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inputMode :: [( (KeyMask, KeySym), (X () ) )] -> X () | |
inputMode xs = do | |
submap . M.fromList $ modeMap where | |
modeMap = [ ( ( km, ks ), do x | |
(submap . M.fromList $ modeMap) ) | |
| ( ( km, ks ), x ) <- xs | |
] ++ [((0, xK_Escape), return ())] | |
moveMode = | |
[ ((0, xK_h), withFocused (keysMoveWindow (-15,0) ) ) | |
, ((0, xK_l), withFocused (keysMoveWindow (15,0) ) ) | |
, ((0, xK_k), withFocused (keysMoveWindow (0,-15) ) ) | |
, ((0, xK_j), withFocused (keysMoveWindow (0,15) ) ) | |
, ((controlMask, xK_h), withFocused (keysMoveWindow (-1,0) ) ) | |
, ((controlMask, xK_l), withFocused (keysMoveWindow (1,0) ) ) | |
, ((controlMask, xK_k), withFocused (keysMoveWindow (0,-1) ) ) | |
, ((controlMask, xK_j), withFocused (keysMoveWindow (0,1) ) ) | |
, ((0, xK_Tab), focusDown ) | |
] | |
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ | |
[ ... | |
-- floating: move and resize with h, j, k, l. These are modes. Just hit modm+g and then | |
-- use plain h,j,k,l. Hit Esc when done | |
, ((modm, xK_g), inputMode moveMode) | |
... | |
] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@byorgey: I totally re wrote the thing to make it a function. BTW your tip is still useful to generate the movMode mapping.