From fae8e88318a68f15317a91f346e490848ea04e46 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 6 Nov 2015 20:54:27 +0000 Subject: Minor changes to xmonad on vali --- .xmonad/xmonad.hs | 34 +++++++++++++++++++++++++--------- 1 file 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 import XMonad.Layout.Renamed import XMonad.Layout.Reflect import XMonad.Layout.OnHost +import XMonad.Layout.Combo +import XMonad.Layout.TwoPane +import XMonad.Layout.WindowNavigation import System.Process import System.Directory (removeFile) import System.Posix.Files @@ -36,7 +39,7 @@ import System.IO.Error import System.IO import XMonad.Hooks.ManageHelpers hiding (CW) import XMonad.StackSet (RationalRect (..)) -import Control.Monad (when) +import Control.Monad (when, filterM) import Graphics.X11.ExtraTypes.XF86 import XMonad.Util.Cursor import XMonad.Actions.Warp @@ -83,13 +86,14 @@ hostFromName h@("vali") = defaultHost { hName = h , hWsp = hWsp , hCoWsp = hCoWsp , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["chromium", "chromium $(xclip -o)"]) - , (xK_e, ["emacsclient -c"]) - ] + , (xK_e, ["emacsclient -c"]) + ] , hScreens = [1, 0] ++ [2,3..] } where workspaceNames = Map.fromList [ (2, "web") , (3, "work") + , (5, "read") , (10, "media") ] hWsp = wspFromMap workspaceNames @@ -128,11 +132,14 @@ tabbedTheme = defaultTheme { activeColor = "black" main = do xmobarProc <- spawnPipe "xmobar" - host <- getHostName >>= return . hostFromName + hostname <- getHostName + let + host = hostFromName hostname + setEnv "HOST" hostname let myConfig = defaultConfig { manageHook = manageDocks <+> hManageHook host , terminal = "urxvtc" - , layoutHook = smartBorders $ avoidStruts layout' + , layoutHook = smartBorders $ avoidStruts $ windowNavigation layout' , logHook = dynamicLogWithPP xmobarPP' , modMask = mod4Mask , keys = \conf -> hKeysMod host conf $ myKeys' conf host @@ -150,7 +157,7 @@ main = do onWorkspace (wsp 8) (withIM (1%5) (Title "Friends") (tabbedLayout tabbedBottomAlways)) $ defaultLayouts ) $ - onHost "vali" ( onWorkspace (wsp 2) (noBorders Full ||| tabbedLayout tabbedBottomAlways) $ + onHost "vali" ( onWorkspace (wsp 2) (noBorders Full ||| tabbedLayout tabbedBottomAlways ||| combineTwo (TwoPane 0.1 0.5) Full (tabbedLayout tabbedBottomAlways)) $ defaultLayouts ) $ defaultLayouts @@ -175,7 +182,8 @@ autostart = [ spawnKeychain spawnKeychain = do home <- liftIO getHomeDirectory let keys = map ((home ) . ("/.ssh/id_" ++)) ["ed25519", "ecdsa", "rsa"] - safeSpawn "urxvt" $ ["-title", "keysetup", "-e", "keychain"] ++ keys + keys' <- filterM (liftIO . doesFileExist) keys + safeSpawn "urxvt" $ ["-title", "keysetup", "-e", "keychain"] ++ keys' assimilateKeychain :: X () assimilateKeychain = liftIO $ assimilateKeychain' >> return () @@ -266,8 +274,16 @@ myKeys' conf host = Map.fromList $ -- Swap the focused window with the previous window , ((modm .|. shiftMask, xK_n ), windows W.swapUp ) - - -- Shrink the master area + + , ((modm, xK_Right), sendMessage $ Go R) + , ((modm, xK_Left ), sendMessage $ Go L) + , ((modm, xK_Up ), sendMessage $ Go U) + , ((modm, xK_Down ), sendMessage $ Go D) + , ((modm .|. shiftMask , xK_Right), sendMessage $ Move R) + , ((modm .|. shiftMask , xK_Left ), sendMessage $ Move L) + , ((modm .|. shiftMask , xK_Up ), sendMessage $ Move U) + , ((modm .|. shiftMask , xK_Down ), sendMessage $ Move D) + -- Shrink the master area , ((modm, xK_h ), sendMessage Shrink) -- Expand the master area -- cgit v1.2.3