From 8552302b1a1953248d01b45f6767c28fd73106e9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 3 Jul 2015 23:53:23 +0200 Subject: vali: keybinding for dwb --- .xmonad/xmonad.hs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to '.xmonad') diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 241785a..5847488 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -46,17 +46,21 @@ import XMonad.Prompt.MySsh import Network.HostName +type KeyMap = Map (ButtonMask, Button) (Window -> X ()) + data Host l1 l2 = Host { hName :: HostName , hManageHook :: ManageHook , hWsp :: Integer -> WorkspaceId , hLayoutMod :: l1 -> l2 + , hKeysMod :: XConfig Layout -> (KeyMap -> KeyMap) } defaultHost = Host { hName = "unkown" , hManageHook = composeOne [manageScratchTerm] , hWsp = show , hLayoutMod = id + , hKeysMod = const id } --hostFromName :: (LayoutClass l1 a, LayoutClass l2 a) => HostName -> Host (l1 a) (l2 a) @@ -66,12 +70,19 @@ hostFromName h@("vali") = defaultHost { hName = h Just str -> show i ++ " " ++ str Nothing -> show i , hLayoutMod = id + , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map spawnBindings conf [ (xK_d, ["dwb", "dwb $(xclip -o)"]) + ] } where workspaceNames = Map.fromList [ (1, "web") ] hostFromName _ = defaultHost +spawnModifiers = [0, controlMask, shiftMask .|. controlMask] +spawnBindings conf (k, cmds) = zipWith (\m cmd -> ((modm .|. mod1Mask .|. m, k), spawn cmd)) spawnModifiers cmds + where + modm = XMonad.modMask conf + manageScratchTerm = resource =? "scratchpad" -?> doRectFloat $ RationalRect (1 % 16) (1 % 16) (7 % 8) (7 % 8) main = do @@ -244,8 +255,6 @@ myKeys' conf = Map.fromList $ , ((modm .|. shiftMask, xK_l ), safeSpawn "slock" []) ] ++ - (join $ map spawnBindings []) - ++ -- -- mod-[1..9], Switch to workspace N @@ -264,7 +273,5 @@ myKeys' conf = Map.fromList $ ] where modm = XMonad.modMask conf - spawnModifiers = [0, controlMask, shiftMask .|. controlMask] - spawnBindings (k, cmds) = zipWith (\m cmd -> ((modm .|. mod1Mask .|. m, k), spawn cmd)) spawnModifiers cmds -- cgit v1.2.3