diff options
-rw-r--r-- | .xmonad/xmonad.hs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 87d780f..6ee9140 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs | |||
@@ -52,12 +52,13 @@ import Control.Applicative ((<$>)) | |||
52 | 52 | ||
53 | type KeyMap = Map (ButtonMask, KeySym) (X ()) | 53 | type KeyMap = Map (ButtonMask, KeySym) (X ()) |
54 | 54 | ||
55 | data Host l1 l2 = Host | 55 | data Host = Host |
56 | { hName :: HostName | 56 | { hName :: HostName |
57 | , hManageHook :: ManageHook | 57 | , hManageHook :: ManageHook |
58 | , hWsp :: Integer -> WorkspaceId | 58 | , hWsp :: Integer -> WorkspaceId |
59 | , hCoWsp :: String -> Maybe WorkspaceId | 59 | , hCoWsp :: String -> Maybe WorkspaceId |
60 | , hKeysMod :: XConfig Layout -> (KeyMap -> KeyMap) | 60 | , hKeysMod :: XConfig Layout -> (KeyMap -> KeyMap) |
61 | , hScreenPerm :: [Integer] -> [Integer] | ||
61 | } | 62 | } |
62 | 63 | ||
63 | defaultHost = Host { hName = "unkown" | 64 | defaultHost = Host { hName = "unkown" |
@@ -65,9 +66,10 @@ defaultHost = Host { hName = "unkown" | |||
65 | , hWsp = show | 66 | , hWsp = show |
66 | , hCoWsp = const Nothing | 67 | , hCoWsp = const Nothing |
67 | , hKeysMod = const id | 68 | , hKeysMod = const id |
69 | , hScreenPerm = id | ||
68 | } | 70 | } |
69 | 71 | ||
70 | --hostFromName :: (LayoutClass l1 a, LayoutClass l2 a) => HostName -> Host (l1 a) (l2 a) | 72 | hostFromName :: HostName -> Host (l1 a) (l2 a) |
71 | hostFromName h@("vali") = defaultHost { hName = h | 73 | hostFromName h@("vali") = defaultHost { hName = h |
72 | , hManageHook = composeOne $ catMaybes [ Just manageScratchTerm | 74 | , hManageHook = composeOne $ catMaybes [ Just manageScratchTerm |
73 | , (\wsp -> className =? ".dwb-wrapped" -?> doShift wsp) <$> hCoWsp "web" | 75 | , (\wsp -> className =? ".dwb-wrapped" -?> doShift wsp) <$> hCoWsp "web" |
@@ -77,12 +79,16 @@ hostFromName h@("vali") = defaultHost { hName = h | |||
77 | , hCoWsp = hCoWsp | 79 | , hCoWsp = hCoWsp |
78 | , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) | 80 | , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) |
79 | ] | 81 | ] |
82 | , hScreenPerm = hScreenPerm | ||
80 | } | 83 | } |
81 | where | 84 | where |
82 | workspaceNames = Map.fromList [ (2, "web") | 85 | workspaceNames = Map.fromList [ (2, "web") |
83 | ] | 86 | ] |
84 | hWsp = wspFromMap workspaceNames | 87 | hWsp = wspFromMap workspaceNames |
85 | hCoWsp = coWspFromMap workspaceNames | 88 | hCoWsp = coWspFromMap workspaceNames |
89 | hScreenPerm 1 = 2 | ||
90 | hScreenPerm 2 = 1 | ||
91 | hScreenPerm x = x | ||
86 | hostFromName _ = defaultHost | 92 | hostFromName _ = defaultHost |
87 | 93 | ||
88 | wspFromMap workspaceNames = \i -> case Map.lookup i workspaceNames of | 94 | wspFromMap workspaceNames = \i -> case Map.lookup i workspaceNames of |
@@ -123,7 +129,7 @@ main = do | |||
123 | , layoutHook = smartBorders $ avoidStruts layout' | 129 | , layoutHook = smartBorders $ avoidStruts layout' |
124 | , logHook = dynamicLogWithPP xmobarPP' | 130 | , logHook = dynamicLogWithPP xmobarPP' |
125 | , modMask = mod4Mask | 131 | , modMask = mod4Mask |
126 | , keys = \conf -> hKeysMod host conf $ myKeys' conf | 132 | , keys = \conf -> hKeysMod host conf $ myKeys' conf host |
127 | , workspaces = take (length numKeys) $ map wsp [1..] | 133 | , workspaces = take (length numKeys) $ map wsp [1..] |
128 | , startupHook = assimilateKeychain >> (sequence autostart) >> (setDefaultCursor xC_left_ptr) >> banishScreen LowerRight >> return () | 134 | , startupHook = assimilateKeychain >> (sequence autostart) >> (setDefaultCursor xC_left_ptr) >> banishScreen LowerRight >> return () |
129 | , normalBorderColor = "#202020" | 135 | , normalBorderColor = "#202020" |
@@ -213,7 +219,7 @@ sshOverrides = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux } | |||
213 | [ "galois", "galois.praseodym.org" | 219 | [ "galois", "galois.praseodym.org" |
214 | ] | 220 | ] |
215 | 221 | ||
216 | myKeys' conf = Map.fromList $ | 222 | myKeys' conf host = Map.fromList $ |
217 | -- launch a terminal | 223 | -- launch a terminal |
218 | [ ((modm, xK_Return), spawn $ (XMonad.terminal conf) ++ " -e tmux") | 224 | [ ((modm, xK_Return), spawn $ (XMonad.terminal conf) ++ " -e tmux") |
219 | , ((modm .|. controlMask, xK_Return), scratchpadSpawnActionCustom $ (XMonad.terminal conf) ++ " -name scratchpad -title scratchpad -e tmux") | 225 | , ((modm .|. controlMask, xK_Return), scratchpadSpawnActionCustom $ (XMonad.terminal conf) ++ " -name scratchpad -title scratchpad -e tmux") |
@@ -299,7 +305,7 @@ myKeys' conf = Map.fromList $ | |||
299 | ] | 305 | ] |
300 | ++ | 306 | ++ |
301 | [((m .|. modm .|. controlMask, k), screenWorkspace i >>= (flip whenJust) (windows . f)) | 307 | [((m .|. modm .|. controlMask, k), screenWorkspace i >>= (flip whenJust) (windows . f)) |
302 | | (i, k) <- zip [0..] [xK_g, xK_c, xK_r, xK_l] | 308 | | (i, k) <- zip (hScreenPerm host [0..]) [xK_g, xK_c, xK_r, xK_l] |
303 | , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] | 309 | , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] |
304 | ] | 310 | ] |
305 | where | 311 | where |