summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2015-07-03 23:53:23 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2015-07-03 23:53:23 +0200
commit8552302b1a1953248d01b45f6767c28fd73106e9 (patch)
treee834c7435e50c7f4e447fe34bb41512ef9c0ce34
parent6d113b9213d8b3ddc694116b63c579b12eea911a (diff)
downloaddotfiles-8552302b1a1953248d01b45f6767c28fd73106e9.tar
dotfiles-8552302b1a1953248d01b45f6767c28fd73106e9.tar.gz
dotfiles-8552302b1a1953248d01b45f6767c28fd73106e9.tar.bz2
dotfiles-8552302b1a1953248d01b45f6767c28fd73106e9.tar.xz
dotfiles-8552302b1a1953248d01b45f6767c28fd73106e9.zip
vali: keybinding for dwb
-rw-r--r--.xmonad/xmonad.hs15
1 files changed, 11 insertions, 4 deletions
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
46 46
47import Network.HostName 47import Network.HostName
48 48
49type KeyMap = Map (ButtonMask, Button) (Window -> X ())
50
49data Host l1 l2 = Host 51data Host l1 l2 = Host
50 { hName :: HostName 52 { hName :: HostName
51 , hManageHook :: ManageHook 53 , hManageHook :: ManageHook
52 , hWsp :: Integer -> WorkspaceId 54 , hWsp :: Integer -> WorkspaceId
53 , hLayoutMod :: l1 -> l2 55 , hLayoutMod :: l1 -> l2
56 , hKeysMod :: XConfig Layout -> (KeyMap -> KeyMap)
54 } 57 }
55 58
56defaultHost = Host { hName = "unkown" 59defaultHost = Host { hName = "unkown"
57 , hManageHook = composeOne [manageScratchTerm] 60 , hManageHook = composeOne [manageScratchTerm]
58 , hWsp = show 61 , hWsp = show
59 , hLayoutMod = id 62 , hLayoutMod = id
63 , hKeysMod = const id
60 } 64 }
61 65
62--hostFromName :: (LayoutClass l1 a, LayoutClass l2 a) => HostName -> Host (l1 a) (l2 a) 66--hostFromName :: (LayoutClass l1 a, LayoutClass l2 a) => HostName -> Host (l1 a) (l2 a)
@@ -66,12 +70,19 @@ hostFromName h@("vali") = defaultHost { hName = h
66 Just str -> show i ++ " " ++ str 70 Just str -> show i ++ " " ++ str
67 Nothing -> show i 71 Nothing -> show i
68 , hLayoutMod = id 72 , hLayoutMod = id
73 , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map spawnBindings conf [ (xK_d, ["dwb", "dwb $(xclip -o)"])
74 ]
69 } 75 }
70 where 76 where
71 workspaceNames = Map.fromList [ (1, "web") 77 workspaceNames = Map.fromList [ (1, "web")
72 ] 78 ]
73hostFromName _ = defaultHost 79hostFromName _ = defaultHost
74 80
81spawnModifiers = [0, controlMask, shiftMask .|. controlMask]
82spawnBindings conf (k, cmds) = zipWith (\m cmd -> ((modm .|. mod1Mask .|. m, k), spawn cmd)) spawnModifiers cmds
83 where
84 modm = XMonad.modMask conf
85
75manageScratchTerm = resource =? "scratchpad" -?> doRectFloat $ RationalRect (1 % 16) (1 % 16) (7 % 8) (7 % 8) 86manageScratchTerm = resource =? "scratchpad" -?> doRectFloat $ RationalRect (1 % 16) (1 % 16) (7 % 8) (7 % 8)
76 87
77main = do 88main = do
@@ -244,8 +255,6 @@ myKeys' conf = Map.fromList $
244 , ((modm .|. shiftMask, xK_l ), safeSpawn "slock" []) 255 , ((modm .|. shiftMask, xK_l ), safeSpawn "slock" [])
245 ] 256 ]
246 ++ 257 ++
247 (join $ map spawnBindings [])
248 ++
249 258
250 -- 259 --
251 -- mod-[1..9], Switch to workspace N 260 -- mod-[1..9], Switch to workspace N
@@ -264,7 +273,5 @@ myKeys' conf = Map.fromList $
264 ] 273 ]
265 where 274 where
266 modm = XMonad.modMask conf 275 modm = XMonad.modMask conf
267 spawnModifiers = [0, controlMask, shiftMask .|. controlMask]
268 spawnBindings (k, cmds) = zipWith (\m cmd -> ((modm .|. mod1Mask .|. m, k), spawn cmd)) spawnModifiers cmds
269 276
270 277