diff options
-rw-r--r-- | .xmonad/xmonad.hs | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index dd748eb..46e3660 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs | |||
@@ -26,6 +26,9 @@ import XMonad.Layout.SimplestFloat | |||
26 | import XMonad.Layout.Renamed | 26 | import XMonad.Layout.Renamed |
27 | import XMonad.Layout.Reflect | 27 | import XMonad.Layout.Reflect |
28 | import XMonad.Layout.OnHost | 28 | import XMonad.Layout.OnHost |
29 | import XMonad.Layout.Combo | ||
30 | import XMonad.Layout.TwoPane | ||
31 | import XMonad.Layout.WindowNavigation | ||
29 | import System.Process | 32 | import System.Process |
30 | import System.Directory (removeFile) | 33 | import System.Directory (removeFile) |
31 | import System.Posix.Files | 34 | import System.Posix.Files |
@@ -36,7 +39,7 @@ import System.IO.Error | |||
36 | import System.IO | 39 | import System.IO |
37 | import XMonad.Hooks.ManageHelpers hiding (CW) | 40 | import XMonad.Hooks.ManageHelpers hiding (CW) |
38 | import XMonad.StackSet (RationalRect (..)) | 41 | import XMonad.StackSet (RationalRect (..)) |
39 | import Control.Monad (when) | 42 | import Control.Monad (when, filterM) |
40 | import Graphics.X11.ExtraTypes.XF86 | 43 | import Graphics.X11.ExtraTypes.XF86 |
41 | import XMonad.Util.Cursor | 44 | import XMonad.Util.Cursor |
42 | import XMonad.Actions.Warp | 45 | import XMonad.Actions.Warp |
@@ -83,13 +86,14 @@ hostFromName h@("vali") = defaultHost { hName = h | |||
83 | , hWsp = hWsp | 86 | , hWsp = hWsp |
84 | , hCoWsp = hCoWsp | 87 | , hCoWsp = hCoWsp |
85 | , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["chromium", "chromium $(xclip -o)"]) | 88 | , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["chromium", "chromium $(xclip -o)"]) |
86 | , (xK_e, ["emacsclient -c"]) | 89 | , (xK_e, ["emacsclient -c"]) |
87 | ] | 90 | ] |
88 | , hScreens = [1, 0] ++ [2,3..] | 91 | , hScreens = [1, 0] ++ [2,3..] |
89 | } | 92 | } |
90 | where | 93 | where |
91 | workspaceNames = Map.fromList [ (2, "web") | 94 | workspaceNames = Map.fromList [ (2, "web") |
92 | , (3, "work") | 95 | , (3, "work") |
96 | , (5, "read") | ||
93 | , (10, "media") | 97 | , (10, "media") |
94 | ] | 98 | ] |
95 | hWsp = wspFromMap workspaceNames | 99 | hWsp = wspFromMap workspaceNames |
@@ -128,11 +132,14 @@ tabbedTheme = defaultTheme { activeColor = "black" | |||
128 | 132 | ||
129 | main = do | 133 | main = do |
130 | xmobarProc <- spawnPipe "xmobar" | 134 | xmobarProc <- spawnPipe "xmobar" |
131 | host <- getHostName >>= return . hostFromName | 135 | hostname <- getHostName |
136 | let | ||
137 | host = hostFromName hostname | ||
138 | setEnv "HOST" hostname | ||
132 | let myConfig = defaultConfig { | 139 | let myConfig = defaultConfig { |
133 | manageHook = manageDocks <+> hManageHook host | 140 | manageHook = manageDocks <+> hManageHook host |
134 | , terminal = "urxvtc" | 141 | , terminal = "urxvtc" |
135 | , layoutHook = smartBorders $ avoidStruts layout' | 142 | , layoutHook = smartBorders $ avoidStruts $ windowNavigation layout' |
136 | , logHook = dynamicLogWithPP xmobarPP' | 143 | , logHook = dynamicLogWithPP xmobarPP' |
137 | , modMask = mod4Mask | 144 | , modMask = mod4Mask |
138 | , keys = \conf -> hKeysMod host conf $ myKeys' conf host | 145 | , keys = \conf -> hKeysMod host conf $ myKeys' conf host |
@@ -150,7 +157,7 @@ main = do | |||
150 | onWorkspace (wsp 8) (withIM (1%5) (Title "Friends") (tabbedLayout tabbedBottomAlways)) $ | 157 | onWorkspace (wsp 8) (withIM (1%5) (Title "Friends") (tabbedLayout tabbedBottomAlways)) $ |
151 | defaultLayouts | 158 | defaultLayouts |
152 | ) $ | 159 | ) $ |
153 | onHost "vali" ( onWorkspace (wsp 2) (noBorders Full ||| tabbedLayout tabbedBottomAlways) $ | 160 | onHost "vali" ( onWorkspace (wsp 2) (noBorders Full ||| tabbedLayout tabbedBottomAlways ||| combineTwo (TwoPane 0.1 0.5) Full (tabbedLayout tabbedBottomAlways)) $ |
154 | defaultLayouts | 161 | defaultLayouts |
155 | ) $ | 162 | ) $ |
156 | defaultLayouts | 163 | defaultLayouts |
@@ -175,7 +182,8 @@ autostart = [ spawnKeychain | |||
175 | spawnKeychain = do | 182 | spawnKeychain = do |
176 | home <- liftIO getHomeDirectory | 183 | home <- liftIO getHomeDirectory |
177 | let keys = map ((home </>) . ("/.ssh/id_" ++)) ["ed25519", "ecdsa", "rsa"] | 184 | let keys = map ((home </>) . ("/.ssh/id_" ++)) ["ed25519", "ecdsa", "rsa"] |
178 | safeSpawn "urxvt" $ ["-title", "keysetup", "-e", "keychain"] ++ keys | 185 | keys' <- filterM (liftIO . doesFileExist) keys |
186 | safeSpawn "urxvt" $ ["-title", "keysetup", "-e", "keychain"] ++ keys' | ||
179 | 187 | ||
180 | assimilateKeychain :: X () | 188 | assimilateKeychain :: X () |
181 | assimilateKeychain = liftIO $ assimilateKeychain' >> return () | 189 | assimilateKeychain = liftIO $ assimilateKeychain' >> return () |
@@ -266,8 +274,16 @@ myKeys' conf host = Map.fromList $ | |||
266 | 274 | ||
267 | -- Swap the focused window with the previous window | 275 | -- Swap the focused window with the previous window |
268 | , ((modm .|. shiftMask, xK_n ), windows W.swapUp ) | 276 | , ((modm .|. shiftMask, xK_n ), windows W.swapUp ) |
269 | 277 | ||
270 | -- Shrink the master area | 278 | , ((modm, xK_Right), sendMessage $ Go R) |
279 | , ((modm, xK_Left ), sendMessage $ Go L) | ||
280 | , ((modm, xK_Up ), sendMessage $ Go U) | ||
281 | , ((modm, xK_Down ), sendMessage $ Go D) | ||
282 | , ((modm .|. shiftMask , xK_Right), sendMessage $ Move R) | ||
283 | , ((modm .|. shiftMask , xK_Left ), sendMessage $ Move L) | ||
284 | , ((modm .|. shiftMask , xK_Up ), sendMessage $ Move U) | ||
285 | , ((modm .|. shiftMask , xK_Down ), sendMessage $ Move D) | ||
286 | -- Shrink the master area | ||
271 | , ((modm, xK_h ), sendMessage Shrink) | 287 | , ((modm, xK_h ), sendMessage Shrink) |
272 | 288 | ||
273 | -- Expand the master area | 289 | -- Expand the master area |