summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2015-11-06 20:54:27 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2015-11-06 20:54:27 +0000
commitfae8e88318a68f15317a91f346e490848ea04e46 (patch)
tree111817068ab00476166ed0fcf918cb3a0bdad165
parentca792273cc9d473e50eec9f64fc8d0046f08b7fc (diff)
downloaddotfiles-fae8e88318a68f15317a91f346e490848ea04e46.tar
dotfiles-fae8e88318a68f15317a91f346e490848ea04e46.tar.gz
dotfiles-fae8e88318a68f15317a91f346e490848ea04e46.tar.bz2
dotfiles-fae8e88318a68f15317a91f346e490848ea04e46.tar.xz
dotfiles-fae8e88318a68f15317a91f346e490848ea04e46.zip
Minor changes to xmonad on vali
-rw-r--r--.xmonad/xmonad.hs34
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
26import XMonad.Layout.Renamed 26import XMonad.Layout.Renamed
27import XMonad.Layout.Reflect 27import XMonad.Layout.Reflect
28import XMonad.Layout.OnHost 28import XMonad.Layout.OnHost
29import XMonad.Layout.Combo
30import XMonad.Layout.TwoPane
31import XMonad.Layout.WindowNavigation
29import System.Process 32import System.Process
30import System.Directory (removeFile) 33import System.Directory (removeFile)
31import System.Posix.Files 34import System.Posix.Files
@@ -36,7 +39,7 @@ import System.IO.Error
36import System.IO 39import System.IO
37import XMonad.Hooks.ManageHelpers hiding (CW) 40import XMonad.Hooks.ManageHelpers hiding (CW)
38import XMonad.StackSet (RationalRect (..)) 41import XMonad.StackSet (RationalRect (..))
39import Control.Monad (when) 42import Control.Monad (when, filterM)
40import Graphics.X11.ExtraTypes.XF86 43import Graphics.X11.ExtraTypes.XF86
41import XMonad.Util.Cursor 44import XMonad.Util.Cursor
42import XMonad.Actions.Warp 45import 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
129main = do 133main = 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
175spawnKeychain = do 182spawnKeychain = 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
180assimilateKeychain :: X () 188assimilateKeychain :: X ()
181assimilateKeychain = liftIO $ assimilateKeychain' >> return () 189assimilateKeychain = 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