From aa7aa6ab4548c4df79a417dda09b40fc1c69eeb0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 13:40:10 +0200 Subject: Tweaked keychain command --- .xmonad/xmonad.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 4e04fee..9566f99 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -132,7 +132,9 @@ autostart = [ spawnKeychain , safeSpawn "urxvtd" ["-q", "-f", "-o"] ] -spawnKeychain = runInTerm "" "keychain ~/.ssh/id_ecdsa ~/.ssh/id_rsa" +spawnKeychain = runInTerm "" $ "keychain " ++ concat keys + where + keys = map ("~/.ssh/id_" ++) ["ed25519", "ecdsa", "rsa"] assimilateKeychain :: X () assimilateKeychain = liftIO $ assimilateKeychain' >> return () -- cgit v1.2.3 From e43e604e967ed5df7b076b5e8f33e550cf0a1709 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 13:46:16 +0200 Subject: Changed order of autostarts --- .xmonad/xmonad.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 9566f99..f19606d 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -128,8 +128,8 @@ main = do } xmonad $ myConfig -autostart = [ spawnKeychain - , safeSpawn "urxvtd" ["-q", "-f", "-o"] +autostart = [ safeSpawn "urxvtd" ["-q", "-f", "-o"] + , spawnKeychain ] spawnKeychain = runInTerm "" $ "keychain " ++ concat keys -- cgit v1.2.3 From a4bd694b08b626ecd99ee17d121a05a2b1d15e19 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 13:54:56 +0200 Subject: explicitly spawning keychain as urxvt --- .xmonad/xmonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index f19606d..49778c5 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -132,7 +132,7 @@ autostart = [ safeSpawn "urxvtd" ["-q", "-f", "-o"] , spawnKeychain ] -spawnKeychain = runInTerm "" $ "keychain " ++ concat keys +spawnKeychain = safeSpawn "urxvt" $ ["-e", "keychain"] ++ keys where keys = map ("~/.ssh/id_" ++) ["ed25519", "ecdsa", "rsa"] -- cgit v1.2.3 From 8f104a3d0352d8d64369f84d3423b73fd369a14c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 13:58:25 +0200 Subject: made urxvt plugin path user local --- .Xdefaults | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Xdefaults b/.Xdefaults index 135f673..0fca06c 100644 --- a/.Xdefaults +++ b/.Xdefaults @@ -11,4 +11,4 @@ URxvt.keysym.M-Escape: perl:keyboard-select:activate URxvt.keysym.M-s: perl:keyboard-select:search URxvt.url-select.launcher: /home/gkleen/.nix-profile/bin/cliparg URxvt.url-select.underline: true -URxvt.perl-lib: /run/current-system/sw/lib/urxvt/perl/ \ No newline at end of file +URxvt.perl-lib: /home/gkleen/.nix-profile/lib/urxvt/perl/ -- cgit v1.2.3 From 7ee7f7ba3b55d89b2cbcf0fedf3bb5c25de7ae2b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 14:16:59 +0200 Subject: Extension of xmonad.hs --- .xmonad/xmonad.hs | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 49778c5..7245ad3 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -14,7 +14,7 @@ import Control.Monad.State (get) import XMonad.Layout.Spiral import Data.Ratio import Data.List -import Data.Maybe (fromMaybe, listToMaybe) +import Data.Maybe (fromMaybe, listToMaybe, catMaybes) import XMonad.Layout.Tabbed import XMonad.Prompt import XMonad.Util.Scratchpad @@ -53,6 +53,7 @@ data Host l1 l2 = Host { hName :: HostName , hManageHook :: ManageHook , hWsp :: Integer -> WorkspaceId + , hCoWsp :: String -> Maybe WorkspaceId , hLayoutMod :: l1 -> l2 , hKeysMod :: XConfig Layout -> (KeyMap -> KeyMap) } @@ -60,25 +61,42 @@ data Host l1 l2 = Host defaultHost = Host { hName = "unkown" , hManageHook = composeOne [manageScratchTerm] , hWsp = show + , hCoWsp = const Nothing , hLayoutMod = id , hKeysMod = const id } --hostFromName :: (LayoutClass l1 a, LayoutClass l2 a) => HostName -> Host (l1 a) (l2 a) hostFromName h@("vali") = defaultHost { hName = h - , hManageHook = hManageHook defaultHost - , hWsp = \i -> case Map.lookup i workspaceNames of - Just str -> show i ++ " " ++ str - Nothing -> show i - , hLayoutMod = id + , hManageHook = composeOne [ manageScratchTerm + , className =? ".dwb-wrapped" -?> doShift (wsp 2) + , className =? "Chromium" -?> doShift (wsp 2) + ] + , hWsp = hWsp + , hCoWsp = hCoWsp + , hLayoutMod = mkMod [ hCoWsp "web" >>= \wsp -> onWorkspace wsp (noBorders Full ||| tabbedLayout tabbedBottomAlways) + ] , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) ] } where workspaceNames = Map.fromList [ (1, "web") ] + hWsp = wspFromMap workspaceNames + hCoWsp = coWspFromMap workspaceNames hostFromName _ = defaultHost +wspFromMap workspaceNames = \i -> case Map.lookup i workspaceNames of + Just str -> show i ++ " " ++ str + Nothing -> show i + +coWspFromMap workspaceNames = \str -> case filter ((== str) . snd) $ Map.toList workspaceNames of + [] -> Nothing + [(i, _)] -> Just $ wspFromMap workspaceNames i + _ -> Nothing + +mkMod = foldl (.) id . catMaybes + spawnModifiers = [0, controlMask, shiftMask .|. controlMask] spawnBindings conf (k, cmds) = zipWith (\m cmd -> ((modm .|. mod1Mask .|. m, k), spawn cmd)) spawnModifiers cmds where -- cgit v1.2.3 From 2eac61501ed8f1a5fe5d94edfafd35ba5043b898 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 14:20:28 +0200 Subject: code cleanup --- .xmonad/xmonad.hs | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 7245ad3..c5d4532 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -68,10 +68,10 @@ defaultHost = Host { hName = "unkown" --hostFromName :: (LayoutClass l1 a, LayoutClass l2 a) => HostName -> Host (l1 a) (l2 a) hostFromName h@("vali") = defaultHost { hName = h - , hManageHook = composeOne [ manageScratchTerm - , className =? ".dwb-wrapped" -?> doShift (wsp 2) - , className =? "Chromium" -?> doShift (wsp 2) - ] + , hManageHook = composeOne $ catMaybes [ Just manageScratchTerm + , hCoWsp "web" >>= \wsp -> (className =? ".dwb-wrapped" -?> doShift wsp) + , hCoWsp "web" >>= \wsp -> (className =? "Chromium" -?> doShift wsp) + ] , hWsp = hWsp , hCoWsp = hCoWsp , hLayoutMod = mkMod [ hCoWsp "web" >>= \wsp -> onWorkspace wsp (noBorders Full ||| tabbedLayout tabbedBottomAlways) @@ -104,6 +104,19 @@ spawnBindings conf (k, cmds) = zipWith (\m cmd -> ((modm .|. mod1Mask .|. m, k), manageScratchTerm = resource =? "scratchpad" -?> doRectFloat $ RationalRect (1 % 16) (1 % 16) (7 % 8) (7 % 8) +tabbedLayout t = renamed [Replace "Tabbed"] $ reflectHoriz $ t CustomShrink $ tabbedTheme +tabbedTheme = defaultTheme { activeColor = "black" + , inactiveColor = "black" + , urgentColor = "black" + , activeBorderColor = "white" + , inactiveBorderColor = "#202020" + , urgentBorderColor = "#bb0000" + , activeTextColor = "white" + , inactiveTextColor = "white" + , urgentTextColor = "white" + , decoHeight = 16 + } + main = do xmobarProc <- spawnPipe "xmobar" host <- getHostName >>= return . hostFromName @@ -121,18 +134,6 @@ main = do } layout' = hLayoutMod host $ defaultLayouts defaultLayouts = spiralWithDir East CW (1 % 2) ||| tabbedLayout tabbedBottom ||| noBorders Full ||| simplestFloat - tabbedLayout t = renamed [Replace "Tabbed"] $ reflectHoriz $ t CustomShrink $ tabbedTheme - tabbedTheme = defaultTheme { activeColor = "black" - , inactiveColor = "black" - , urgentColor = "black" - , activeBorderColor = "white" - , inactiveBorderColor = "#202020" - , urgentBorderColor = "#bb0000" - , activeTextColor = "white" - , inactiveTextColor = "white" - , urgentTextColor = "white" - , decoHeight = 16 - } xmobarPP' = xmobarPP { ppOutput = hPutStrLn xmobarProc , ppTitle = shorten 50 , ppSort = (liftM2 (.)) getSortByIndex $ return scratchpadFilterOutWorkspace -- cgit v1.2.3 From 31e504757ac68ea2b3ad1303665453f7e0342806 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 14:22:15 +0200 Subject: Switched to applicative --- .xmonad/xmonad.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index c5d4532..8321f25 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -47,6 +47,8 @@ import XMonad.Prompt.MySsh import Network.HostName +import Control.Applicative (<$>) + type KeyMap = Map (ButtonMask, KeySym) (X ()) data Host l1 l2 = Host @@ -69,12 +71,12 @@ defaultHost = Host { hName = "unkown" --hostFromName :: (LayoutClass l1 a, LayoutClass l2 a) => HostName -> Host (l1 a) (l2 a) hostFromName h@("vali") = defaultHost { hName = h , hManageHook = composeOne $ catMaybes [ Just manageScratchTerm - , hCoWsp "web" >>= \wsp -> (className =? ".dwb-wrapped" -?> doShift wsp) - , hCoWsp "web" >>= \wsp -> (className =? "Chromium" -?> doShift wsp) + , (\wsp -> className =? ".dwb-wrapped" -?> doShift wsp) <$> hCoWsp "web" + , (\wsp -> className =? "Chromium" -?> doShift wsp) <$> hCoWsp "web" ] , hWsp = hWsp , hCoWsp = hCoWsp - , hLayoutMod = mkMod [ hCoWsp "web" >>= \wsp -> onWorkspace wsp (noBorders Full ||| tabbedLayout tabbedBottomAlways) + , hLayoutMod = mkMod [ (\wsp -> onWorkspace wsp $ noBorders Full ||| tabbedLayout tabbedBottomAlways) <$> hCoWsp "web" ] , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) ] -- cgit v1.2.3 From 88250cf5e4ab01c2e20d8e9ba85db12eb2342b92 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 14:22:39 +0200 Subject: syntax --- .xmonad/xmonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 8321f25..2877be1 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -47,7 +47,7 @@ import XMonad.Prompt.MySsh import Network.HostName -import Control.Applicative (<$>) +import Control.Applicative ((<$>)) type KeyMap = Map (ButtonMask, KeySym) (X ()) -- cgit v1.2.3 From 47a4a723f34f54a180e8e0e0e775e6262ef752b0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 14:23:45 +0200 Subject: Type finangling --- .xmonad/xmonad.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 2877be1..fadc49a 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -76,7 +76,7 @@ hostFromName h@("vali") = defaultHost { hName = h ] , hWsp = hWsp , hCoWsp = hCoWsp - , hLayoutMod = mkMod [ (\wsp -> onWorkspace wsp $ noBorders Full ||| tabbedLayout tabbedBottomAlways) <$> hCoWsp "web" + , hLayoutMod = mkMod [ (\wsp -> onWorkspace wsp (noBorders Full ||| tabbedLayout tabbedBottomAlways)) <$> hCoWsp "web" ] , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) ] @@ -86,6 +86,7 @@ hostFromName h@("vali") = defaultHost { hName = h ] hWsp = wspFromMap workspaceNames hCoWsp = coWspFromMap workspaceNames + mkMod = foldl (.) id . catMaybes hostFromName _ = defaultHost wspFromMap workspaceNames = \i -> case Map.lookup i workspaceNames of @@ -97,8 +98,6 @@ coWspFromMap workspaceNames = \str -> case filter ((== str) . snd) $ Map.toList [(i, _)] -> Just $ wspFromMap workspaceNames i _ -> Nothing -mkMod = foldl (.) id . catMaybes - spawnModifiers = [0, controlMask, shiftMask .|. controlMask] spawnBindings conf (k, cmds) = zipWith (\m cmd -> ((modm .|. mod1Mask .|. m, k), spawn cmd)) spawnModifiers cmds where -- cgit v1.2.3 From d8a45dd9e240ae16c42db0b79c50a8e63c0daaff Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 14:28:03 +0200 Subject: more type wrangling --- .xmonad/xmonad.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index fadc49a..8813651 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -76,8 +76,7 @@ hostFromName h@("vali") = defaultHost { hName = h ] , hWsp = hWsp , hCoWsp = hCoWsp - , hLayoutMod = mkMod [ (\wsp -> onWorkspace wsp (noBorders Full ||| tabbedLayout tabbedBottomAlways)) <$> hCoWsp "web" - ] + , hLayoutMod = maybe' applyWeb , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) ] } @@ -86,7 +85,8 @@ hostFromName h@("vali") = defaultHost { hName = h ] hWsp = wspFromMap workspaceNames hCoWsp = coWspFromMap workspaceNames - mkMod = foldl (.) id . catMaybes + maybe' = fromMaybe id + applyWeb = (\wsp -> onWorkspace wsp (noBorders Full ||| tabbedLayout tabbedBottomAlways)) <$> hCoWsp "web" hostFromName _ = defaultHost wspFromMap workspaceNames = \i -> case Map.lookup i workspaceNames of -- cgit v1.2.3 From 99bbf037e6966dd17c5dd1026b1dc5d1cedba13c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 14:29:24 +0200 Subject: workspace numbers need to be statically known because layouts are type-level --- .xmonad/xmonad.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 8813651..e1ed49b 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -76,7 +76,7 @@ hostFromName h@("vali") = defaultHost { hName = h ] , hWsp = hWsp , hCoWsp = hCoWsp - , hLayoutMod = maybe' applyWeb + , hLayoutMod = onWorkspace (hWsp 1) (noBorders Full ||| tabbedLayout tabbedBottomAlways) , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) ] } @@ -85,8 +85,6 @@ hostFromName h@("vali") = defaultHost { hName = h ] hWsp = wspFromMap workspaceNames hCoWsp = coWspFromMap workspaceNames - maybe' = fromMaybe id - applyWeb = (\wsp -> onWorkspace wsp (noBorders Full ||| tabbedLayout tabbedBottomAlways)) <$> hCoWsp "web" hostFromName _ = defaultHost wspFromMap workspaceNames = \i -> case Map.lookup i workspaceNames of -- cgit v1.2.3 From 903cb3786747f04e01a6a5f35a6bd9f10a3ff14c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 14:34:04 +0200 Subject: Removed per-host layout modifiers --- .xmonad/xmonad.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index e1ed49b..4cc7f63 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -56,7 +56,6 @@ data Host l1 l2 = Host , hManageHook :: ManageHook , hWsp :: Integer -> WorkspaceId , hCoWsp :: String -> Maybe WorkspaceId - , hLayoutMod :: l1 -> l2 , hKeysMod :: XConfig Layout -> (KeyMap -> KeyMap) } @@ -64,7 +63,6 @@ defaultHost = Host { hName = "unkown" , hManageHook = composeOne [manageScratchTerm] , hWsp = show , hCoWsp = const Nothing - , hLayoutMod = id , hKeysMod = const id } @@ -76,7 +74,6 @@ hostFromName h@("vali") = defaultHost { hName = h ] , hWsp = hWsp , hCoWsp = hCoWsp - , hLayoutMod = onWorkspace (hWsp 1) (noBorders Full ||| tabbedLayout tabbedBottomAlways) , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) ] } @@ -131,7 +128,13 @@ main = do , normalBorderColor = "#202020" , focusedBorderColor = "white" } - layout' = hLayoutMod host $ defaultLayouts + -- We can´t define per-host layout modifiers because we lack dependent types + layout' = onWorkspace (wsp 1) (noBorders Full ||| withIM (1%5) (Title "Buddy List") (tabbedLayout tabbedBottomAlways)) $ + onWorkspace (wsp 10) (noBorders Full) $ + onWorkspace (wsp 2) (noBorders Full ||| tabbedLayout tabbedBottomAlways) $ + onWorkspace (wsp 5) (tabbedLayout tabbedBottomAlways) $ + onWorkspace (wsp 8) (withIM (1%5) (Title "Friends") (tabbedLayout tabbedBottomAlways)) $ + defaultLayouts defaultLayouts = spiralWithDir East CW (1 % 2) ||| tabbedLayout tabbedBottom ||| noBorders Full ||| simplestFloat xmobarPP' = xmobarPP { ppOutput = hPutStrLn xmobarProc , ppTitle = shorten 50 -- cgit v1.2.3 From 8f008a3c52e156e07dd35edd1e69651a6f17c648 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 14:34:57 +0200 Subject: Fixed copied code part --- .xmonad/xmonad.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 4cc7f63..e6a581d 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -123,11 +123,12 @@ main = do , logHook = dynamicLogWithPP xmobarPP' , modMask = mod4Mask , keys = \conf -> hKeysMod host conf $ myKeys' conf - , workspaces = take (length numKeys) $ map (hWsp host) [1..] + , workspaces = take (length numKeys) $ map wsp [1..] , startupHook = assimilateKeychain >> (sequence autostart) >> (setDefaultCursor xC_left_ptr) >> banishScreen LowerRight >> return () , normalBorderColor = "#202020" , focusedBorderColor = "white" } + wsp = hWsp host -- We can´t define per-host layout modifiers because we lack dependent types layout' = onWorkspace (wsp 1) (noBorders Full ||| withIM (1%5) (Title "Buddy List") (tabbedLayout tabbedBottomAlways)) $ onWorkspace (wsp 10) (noBorders Full) $ -- cgit v1.2.3 From b444dd254cc983228afa61795d25a4ea11e0bc31 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 14:36:43 +0200 Subject: per-host selection of available workspaces --- .xmonad/xmonad.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index e6a581d..c0f1049 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -64,6 +64,7 @@ defaultHost = Host { hName = "unkown" , hWsp = show , hCoWsp = const Nothing , hKeysMod = const id + , hWspList = [1..] } --hostFromName :: (LayoutClass l1 a, LayoutClass l2 a) => HostName -> Host (l1 a) (l2 a) @@ -76,9 +77,10 @@ hostFromName h@("vali") = defaultHost { hName = h , hCoWsp = hCoWsp , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) ] + , hWspList = [2..] } where - workspaceNames = Map.fromList [ (1, "web") + workspaceNames = Map.fromList [ (2, "web") ] hWsp = wspFromMap workspaceNames hCoWsp = coWspFromMap workspaceNames @@ -123,7 +125,7 @@ main = do , logHook = dynamicLogWithPP xmobarPP' , modMask = mod4Mask , keys = \conf -> hKeysMod host conf $ myKeys' conf - , workspaces = take (length numKeys) $ map wsp [1..] + , workspaces = take (length numKeys) $ map wsp (hWspList host) , startupHook = assimilateKeychain >> (sequence autostart) >> (setDefaultCursor xC_left_ptr) >> banishScreen LowerRight >> return () , normalBorderColor = "#202020" , focusedBorderColor = "white" -- cgit v1.2.3 From 92fdd2b1e4c24066f777c4f1a77e277642accb4b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 4 Jul 2015 14:37:18 +0200 Subject: Record fix --- .xmonad/xmonad.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index c0f1049..cdffaa8 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -57,6 +57,7 @@ data Host l1 l2 = Host , hWsp :: Integer -> WorkspaceId , hCoWsp :: String -> Maybe WorkspaceId , hKeysMod :: XConfig Layout -> (KeyMap -> KeyMap) + , hWspList :: [Integer] } defaultHost = Host { hName = "unkown" -- cgit v1.2.3 From 8de3d902ae7df10c3444cf4b2993d132c3efaea1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 21:35:49 +0200 Subject: First try at .emacs --- .emacs | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .emacs diff --git a/.emacs b/.emacs new file mode 100644 index 0000000..4bb3336 --- /dev/null +++ b/.emacs @@ -0,0 +1,63 @@ +(defun ensure-package-installed (&rest packages) + "Assure every package is installed, ask for installation if it’s not. + +Return a list of installed packages or nil for every skipped package." + (mapcar + (lambda (package) + ;; (package-installed-p 'evil) + (if (package-installed-p package) + nil + (if (y-or-n-p (format "Package %s is missing. Install it? " package)) + (package-install package) + package))) + packages)) + +;; make sure to have downloaded archive description. +;; Or use package-archive-contents as suggested by Nicolas Dudebout +(or (file-exists-p package-user-dir) + (package-refresh-contents)) + +(require 'package) +(add-to-list 'package-archives + '("marmaled" . "http://marmalade-repo.org/packages/") t) +(when (< emacs-major-version 24) + ;; For important compatibility libraries like cl-lib + (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) + +(ensure-package-installed 'color-theme 'evil 'evil-dvorak 'undo-tree 'zenburn-theme 'magit 'haskell-mode) + +;; activate installed packages +(package-initialize) + +(add-to-list 'load-path "~/.nix-profile/share/emacs/site-lisp/") +(add-to-list 'load-path "/run/current-system/sw/share/emacs/site-lisp/") + +(menu-bar-mode -1) +(scroll-bar-mode -1) + +(require 'evil) +(evil-mode 1) + +(require 'color-theme) +(color-theme-initialize) +(if (daemonp) + (add-hook 'after-make-frame-functions + (lambda (frame) + (with-selected-frame frame + (color-theme-ld-dark)))) + (color-theme-ld-dark) + ) + +(global-undo-tree-mode) + +(set-default-font "DejaVu Sans Mono") +(tool-bar-mode -1) + +(global-set-key (kbd "RET") 'newline-and-indent) +(global-set-key (kbd "M-g") 'magit-status) + +(setq backup-directory-alist `(("." . "~/.saves"))) +(setq delete-old-versions t + kept-new-versions 6 + kept-old-versions 2 + version-control t) -- cgit v1.2.3 From 0f074a7e25da6ef4f6aaf0433cc48dfd5b353415 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 21:51:43 +0200 Subject: Fixes to .emacs --- .emacs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.emacs b/.emacs index 4bb3336..27eb5ce 100644 --- a/.emacs +++ b/.emacs @@ -1,3 +1,12 @@ +(require 'package) + +(add-to-list 'package-archives + '("marmaled" . "http://marmalade-repo.org/packages/") t) +(when (< emacs-major-version 24) + ;; For important compatibility libraries like cl-lib + (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) + + (defun ensure-package-installed (&rest packages) "Assure every package is installed, ask for installation if it’s not. @@ -17,13 +26,6 @@ Return a list of installed packages or nil for every skipped package." (or (file-exists-p package-user-dir) (package-refresh-contents)) -(require 'package) -(add-to-list 'package-archives - '("marmaled" . "http://marmalade-repo.org/packages/") t) -(when (< emacs-major-version 24) - ;; For important compatibility libraries like cl-lib - (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) - (ensure-package-installed 'color-theme 'evil 'evil-dvorak 'undo-tree 'zenburn-theme 'magit 'haskell-mode) ;; activate installed packages -- cgit v1.2.3 From 8021595407c5338f408afcb2eba0ddbd7fb331eb Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 21:54:35 +0200 Subject: Fixes to .emacs --- .emacs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.emacs b/.emacs index 27eb5ce..ee4bb1e 100644 --- a/.emacs +++ b/.emacs @@ -6,6 +6,7 @@ ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) +(package-initialize) (defun ensure-package-installed (&rest packages) "Assure every package is installed, ask for installation if it’s not. @@ -28,7 +29,6 @@ Return a list of installed packages or nil for every skipped package." (ensure-package-installed 'color-theme 'evil 'evil-dvorak 'undo-tree 'zenburn-theme 'magit 'haskell-mode) -;; activate installed packages (package-initialize) (add-to-list 'load-path "~/.nix-profile/share/emacs/site-lisp/") -- cgit v1.2.3 From f34fb82051b0ad29c4786fe2848fe2e65031f9d9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 21:57:38 +0200 Subject: Added MELPA to .emacs --- .emacs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.emacs b/.emacs index ee4bb1e..9342025 100644 --- a/.emacs +++ b/.emacs @@ -2,6 +2,8 @@ (add-to-list 'package-archives '("marmaled" . "http://marmalade-repo.org/packages/") t) +(add-to-list 'package-archives + '("melpa" . "http://melpa.org/packages/")) (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) -- cgit v1.2.3 From 4fb45bb2e553f1447440f30e74877124aada68d5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:06:33 +0200 Subject: Added Fix to haskell faces to .emacs --- .emacs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.emacs b/.emacs index 9342025..438b60f 100644 --- a/.emacs +++ b/.emacs @@ -65,3 +65,10 @@ Return a list of installed packages or nil for every skipped package." kept-new-versions 6 kept-old-versions 2 version-control t) + +(custom-set-variables + '(haskell-font-lock-symbols t)) +(custom-set-faces + '(font-lock-type-face ((t (:foreground "PaleGreen" :weight bold)))) + '(font-lock-function-face ((t (:foreground "LightSkyBlue" :weight bold)))) + ) -- cgit v1.2.3 From b660ccf2f4cab8b80596949cadd269a0d03a0325 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:17:59 +0200 Subject: Added XMonad.Layout.OnHost to xmonad.hs --- .xmonad/xmonad.hs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index cdffaa8..50766ac 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -25,6 +25,7 @@ import XMonad.Layout.PerWorkspace import XMonad.Layout.SimplestFloat import XMonad.Layout.Renamed import XMonad.Layout.Reflect +import XMonad.Layout.OnHost import System.Process import System.Directory (removeFile) import System.Posix.Files @@ -57,7 +58,6 @@ data Host l1 l2 = Host , hWsp :: Integer -> WorkspaceId , hCoWsp :: String -> Maybe WorkspaceId , hKeysMod :: XConfig Layout -> (KeyMap -> KeyMap) - , hWspList :: [Integer] } defaultHost = Host { hName = "unkown" @@ -65,7 +65,6 @@ defaultHost = Host { hName = "unkown" , hWsp = show , hCoWsp = const Nothing , hKeysMod = const id - , hWspList = [1..] } --hostFromName :: (LayoutClass l1 a, LayoutClass l2 a) => HostName -> Host (l1 a) (l2 a) @@ -78,7 +77,6 @@ hostFromName h@("vali") = defaultHost { hName = h , hCoWsp = hCoWsp , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) ] - , hWspList = [2..] } where workspaceNames = Map.fromList [ (2, "web") @@ -126,19 +124,23 @@ main = do , logHook = dynamicLogWithPP xmobarPP' , modMask = mod4Mask , keys = \conf -> hKeysMod host conf $ myKeys' conf - , workspaces = take (length numKeys) $ map wsp (hWspList host) + , workspaces = take (length numKeys) $ map wsp [1..] , startupHook = assimilateKeychain >> (sequence autostart) >> (setDefaultCursor xC_left_ptr) >> banishScreen LowerRight >> return () , normalBorderColor = "#202020" , focusedBorderColor = "white" } wsp = hWsp host -- We can´t define per-host layout modifiers because we lack dependent types - layout' = onWorkspace (wsp 1) (noBorders Full ||| withIM (1%5) (Title "Buddy List") (tabbedLayout tabbedBottomAlways)) $ - onWorkspace (wsp 10) (noBorders Full) $ - onWorkspace (wsp 2) (noBorders Full ||| tabbedLayout tabbedBottomAlways) $ - onWorkspace (wsp 5) (tabbedLayout tabbedBottomAlways) $ - onWorkspace (wsp 8) (withIM (1%5) (Title "Friends") (tabbedLayout tabbedBottomAlways)) $ - defaultLayouts + layout' = onHost "skadhi" ( onWorkspace (wsp 1) (noBorders Full ||| withIM (1%5) (Title "Buddy List") (tabbedLayout tabbedBottomAlways)) $ + onWorkspace (wsp 10) (noBorders Full) $ + onWorkspace (wsp 2) (noBorders Full ||| tabbedLayout tabbedBottomAlways) $ + onWorkspace (wsp 5) (tabbedLayout tabbedBottomAlways) $ + onWorkspace (wsp 8) (withIM (1%5) (Title "Friends") (tabbedLayout tabbedBottomAlways)) $ + defaultLayouts + ) $ + onHost "vali" ( onWorkspace (wsp 2) (noBorders Full ||| tabbedLayout tabbedBottomAlways) $ + defaultLayouts + ) defaultLayouts = spiralWithDir East CW (1 % 2) ||| tabbedLayout tabbedBottom ||| noBorders Full ||| simplestFloat xmobarPP' = xmobarPP { ppOutput = hPutStrLn xmobarProc , ppTitle = shorten 50 -- cgit v1.2.3 From 8325e5ea5d93712e158568da1434b3beb42e52a2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:21:25 +0200 Subject: Added missing argument --- .xmonad/xmonad.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 50766ac..87d780f 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -140,7 +140,8 @@ main = do ) $ onHost "vali" ( onWorkspace (wsp 2) (noBorders Full ||| tabbedLayout tabbedBottomAlways) $ defaultLayouts - ) + ) $ + defaultLayouts defaultLayouts = spiralWithDir East CW (1 % 2) ||| tabbedLayout tabbedBottom ||| noBorders Full ||| simplestFloat xmobarPP' = xmobarPP { ppOutput = hPutStrLn xmobarProc , ppTitle = shorten 50 -- cgit v1.2.3 From b0c55c16b555aa6d5d1a30b327f77b42399ea66e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:26:57 +0200 Subject: Introduced permutations to screen numbers in order to be more intuitive --- .xmonad/xmonad.hs | 16 +++++++++++----- 1 file 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 ((<$>)) type KeyMap = Map (ButtonMask, KeySym) (X ()) -data Host l1 l2 = Host +data Host = Host { hName :: HostName , hManageHook :: ManageHook , hWsp :: Integer -> WorkspaceId , hCoWsp :: String -> Maybe WorkspaceId , hKeysMod :: XConfig Layout -> (KeyMap -> KeyMap) + , hScreenPerm :: [Integer] -> [Integer] } defaultHost = Host { hName = "unkown" @@ -65,9 +66,10 @@ defaultHost = Host { hName = "unkown" , hWsp = show , hCoWsp = const Nothing , hKeysMod = const id + , hScreenPerm = id } ---hostFromName :: (LayoutClass l1 a, LayoutClass l2 a) => HostName -> Host (l1 a) (l2 a) +hostFromName :: HostName -> Host (l1 a) (l2 a) hostFromName h@("vali") = defaultHost { hName = h , hManageHook = composeOne $ catMaybes [ Just manageScratchTerm , (\wsp -> className =? ".dwb-wrapped" -?> doShift wsp) <$> hCoWsp "web" @@ -77,12 +79,16 @@ hostFromName h@("vali") = defaultHost { hName = h , hCoWsp = hCoWsp , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) ] + , hScreenPerm = hScreenPerm } where workspaceNames = Map.fromList [ (2, "web") ] hWsp = wspFromMap workspaceNames hCoWsp = coWspFromMap workspaceNames + hScreenPerm 1 = 2 + hScreenPerm 2 = 1 + hScreenPerm x = x hostFromName _ = defaultHost wspFromMap workspaceNames = \i -> case Map.lookup i workspaceNames of @@ -123,7 +129,7 @@ main = do , layoutHook = smartBorders $ avoidStruts layout' , logHook = dynamicLogWithPP xmobarPP' , modMask = mod4Mask - , keys = \conf -> hKeysMod host conf $ myKeys' conf + , keys = \conf -> hKeysMod host conf $ myKeys' conf host , workspaces = take (length numKeys) $ map wsp [1..] , startupHook = assimilateKeychain >> (sequence autostart) >> (setDefaultCursor xC_left_ptr) >> banishScreen LowerRight >> return () , normalBorderColor = "#202020" @@ -213,7 +219,7 @@ sshOverrides = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux } [ "galois", "galois.praseodym.org" ] -myKeys' conf = Map.fromList $ +myKeys' conf host = Map.fromList $ -- launch a terminal [ ((modm, xK_Return), spawn $ (XMonad.terminal conf) ++ " -e tmux") , ((modm .|. controlMask, xK_Return), scratchpadSpawnActionCustom $ (XMonad.terminal conf) ++ " -name scratchpad -title scratchpad -e tmux") @@ -299,7 +305,7 @@ myKeys' conf = Map.fromList $ ] ++ [((m .|. modm .|. controlMask, k), screenWorkspace i >>= (flip whenJust) (windows . f)) - | (i, k) <- zip [0..] [xK_g, xK_c, xK_r, xK_l] + | (i, k) <- zip (hScreenPerm host [0..]) [xK_g, xK_c, xK_r, xK_l] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] ] where -- cgit v1.2.3 From 20926877d27f448e038159c037a94e55aed38325 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:28:15 +0200 Subject: Removed type artifact --- .xmonad/xmonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 6ee9140..a41e4d0 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -69,7 +69,7 @@ defaultHost = Host { hName = "unkown" , hScreenPerm = id } -hostFromName :: HostName -> Host (l1 a) (l2 a) +hostFromName :: HostName -> Host hostFromName h@("vali") = defaultHost { hName = h , hManageHook = composeOne $ catMaybes [ Just manageScratchTerm , (\wsp -> className =? ".dwb-wrapped" -?> doShift wsp) <$> hCoWsp "web" -- cgit v1.2.3 From 912c33e92c5981a5275572030986790d13a2acf5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:29:31 +0200 Subject: ScreenIds are ScreenId's not Integer's --- .xmonad/xmonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index a41e4d0..569d428 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -58,7 +58,7 @@ data Host = Host , hWsp :: Integer -> WorkspaceId , hCoWsp :: String -> Maybe WorkspaceId , hKeysMod :: XConfig Layout -> (KeyMap -> KeyMap) - , hScreenPerm :: [Integer] -> [Integer] + , hScreenPerm :: [ScreenId] -> [ScreenId] } defaultHost = Host { hName = "unkown" -- cgit v1.2.3 From 4589fe7915a52ab216897782aea378b07076b61f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:31:21 +0200 Subject: Proper type for hScreenPerm --- .xmonad/xmonad.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 569d428..287247d 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -86,9 +86,11 @@ hostFromName h@("vali") = defaultHost { hName = h ] hWsp = wspFromMap workspaceNames hCoWsp = coWspFromMap workspaceNames - hScreenPerm 1 = 2 - hScreenPerm 2 = 1 - hScreenPerm x = x + hScreenPerm = map hPrim + where + hPrim 1 = 2 + hPrim 2 = 1 + hPrim x = x hostFromName _ = defaultHost wspFromMap workspaceNames = \i -> case Map.lookup i workspaceNames of -- cgit v1.2.3 From a4f614f137f07891faa66177366957348e20548a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:35:18 +0200 Subject: "Simplified" screen permutations --- .xmonad/xmonad.hs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 287247d..903eff4 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -58,7 +58,7 @@ data Host = Host , hWsp :: Integer -> WorkspaceId , hCoWsp :: String -> Maybe WorkspaceId , hKeysMod :: XConfig Layout -> (KeyMap -> KeyMap) - , hScreenPerm :: [ScreenId] -> [ScreenId] + , hScreens :: [ScreenId] } defaultHost = Host { hName = "unkown" @@ -66,7 +66,7 @@ defaultHost = Host { hName = "unkown" , hWsp = show , hCoWsp = const Nothing , hKeysMod = const id - , hScreenPerm = id + , hScreens = [0..] } hostFromName :: HostName -> Host @@ -79,18 +79,13 @@ hostFromName h@("vali") = defaultHost { hName = h , hCoWsp = hCoWsp , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) ] - , hScreenPerm = hScreenPerm + , hScreens = [1, 0, 2..] } where workspaceNames = Map.fromList [ (2, "web") ] hWsp = wspFromMap workspaceNames hCoWsp = coWspFromMap workspaceNames - hScreenPerm = map hPrim - where - hPrim 1 = 2 - hPrim 2 = 1 - hPrim x = x hostFromName _ = defaultHost wspFromMap workspaceNames = \i -> case Map.lookup i workspaceNames of @@ -307,7 +302,7 @@ myKeys' conf host = Map.fromList $ ] ++ [((m .|. modm .|. controlMask, k), screenWorkspace i >>= (flip whenJust) (windows . f)) - | (i, k) <- zip (hScreenPerm host [0..]) [xK_g, xK_c, xK_r, xK_l] + | (i, k) <- zip (hScreens host) [xK_g, xK_c, xK_r, xK_l] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] ] where -- cgit v1.2.3 From 00bf13197996c7db9cc7bee07e423bef75ffdb93 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:38:01 +0200 Subject: Tweaked list ranges for syntax --- .xmonad/xmonad.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 903eff4..c172147 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -66,7 +66,7 @@ defaultHost = Host { hName = "unkown" , hWsp = show , hCoWsp = const Nothing , hKeysMod = const id - , hScreens = [0..] + , hScreens = [0,1..] } hostFromName :: HostName -> Host @@ -79,7 +79,7 @@ hostFromName h@("vali") = defaultHost { hName = h , hCoWsp = hCoWsp , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) ] - , hScreens = [1, 0, 2..] + , hScreens = [1, 0] ++ [2,3..] } where workspaceNames = Map.fromList [ (2, "web") -- cgit v1.2.3 From 4cb0c1bfd386a3a9bf69bc94d8d394988565dffe Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:43:03 +0200 Subject: Better workspace assignments & emacs on vali --- .xmonad/xmonad.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index c172147..c0a18c3 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -72,8 +72,9 @@ defaultHost = Host { hName = "unkown" hostFromName :: HostName -> Host hostFromName h@("vali") = defaultHost { hName = h , hManageHook = composeOne $ catMaybes [ Just manageScratchTerm - , (\wsp -> className =? ".dwb-wrapped" -?> doShift wsp) <$> hCoWsp "web" - , (\wsp -> className =? "Chromium" -?> doShift wsp) <$> hCoWsp "web" + , assign "web" $ className =? ".dwb-wrapped" + , assign "web" $ className =? "Chromium" + , assign "work" $ className =? "Emacs" ] , hWsp = hWsp , hCoWsp = hCoWsp @@ -83,9 +84,11 @@ hostFromName h@("vali") = defaultHost { hName = h } where workspaceNames = Map.fromList [ (2, "web") + , (3, "work") ] hWsp = wspFromMap workspaceNames hCoWsp = coWspFromMap workspaceNames + assign wsp test = (\wsp -> test -?> doShift wsp) <$> hCoWsp wsp hostFromName _ = defaultHost wspFromMap workspaceNames = \i -> case Map.lookup i workspaceNames of -- cgit v1.2.3 From 67ad6c4f892aade9060ab4e218685bfe331d4991 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:49:49 +0200 Subject: Added systemd units for emacs and urxvtd --- .config/systemd/user/default.target.wants/emacs.service | 1 + .config/systemd/user/default.target.wants/urxvtd.service | 1 + .config/systemd/user/emacs.service | 12 ++++++++++++ .config/systemd/user/urxvtd.service | 10 ++++++++++ 4 files changed, 24 insertions(+) create mode 120000 .config/systemd/user/default.target.wants/emacs.service create mode 120000 .config/systemd/user/default.target.wants/urxvtd.service create mode 100644 .config/systemd/user/emacs.service create mode 100644 .config/systemd/user/urxvtd.service diff --git a/.config/systemd/user/default.target.wants/emacs.service b/.config/systemd/user/default.target.wants/emacs.service new file mode 120000 index 0000000..ae565e2 --- /dev/null +++ b/.config/systemd/user/default.target.wants/emacs.service @@ -0,0 +1 @@ +/home/gkleen/.config/systemd/user/emacs.service \ No newline at end of file diff --git a/.config/systemd/user/default.target.wants/urxvtd.service b/.config/systemd/user/default.target.wants/urxvtd.service new file mode 120000 index 0000000..a0216ce --- /dev/null +++ b/.config/systemd/user/default.target.wants/urxvtd.service @@ -0,0 +1 @@ +/home/gkleen/.config/systemd/user/urxvtd.service \ No newline at end of file diff --git a/.config/systemd/user/emacs.service b/.config/systemd/user/emacs.service new file mode 100644 index 0000000..9f9e4f9 --- /dev/null +++ b/.config/systemd/user/emacs.service @@ -0,0 +1,12 @@ +[Unit] +Description=Emacs: the extensible, self-documenting text editor + +[Service] +Type=forking +ExecStart=%s -c "emacs --daemon" +ExecStop=%s -c 'emacsclient --eval "(kill-emacs)"' +Environment=PATH=%h/bin:/var/setuid-wrappers:%h/.nix-profile/bin:%h/.nix-profile/sbin:%h/.nix-profile/lib/kde4/libexec:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/nix/var/nix/profiles/default/lib/kde4/libexec:/run/current-system/sw/bin:/run/current-system/sw/sbin:/run/current-system/sw/lib/kde4/libexec +Restart=always + +[Install] +WantedBy=default.target diff --git a/.config/systemd/user/urxvtd.service b/.config/systemd/user/urxvtd.service new file mode 100644 index 0000000..4efe794 --- /dev/null +++ b/.config/systemd/user/urxvtd.service @@ -0,0 +1,10 @@ +[Unit] +Description=urxvtd - urxvt terminal daemon + +[Service] +Type=simple +ExecStart=%s -c urxvtd +Restart=always + +[Install] +WantedBy=default.target -- cgit v1.2.3 From 1ebe553662f95c877acd716555aee404af994420 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:50:43 +0200 Subject: Removed urxvtd from xmonad.hs due to now existant systemd unit --- .xmonad/xmonad.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index c0a18c3..0687afb 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -162,8 +162,7 @@ main = do } xmonad $ myConfig -autostart = [ safeSpawn "urxvtd" ["-q", "-f", "-o"] - , spawnKeychain +autostart = [ spawnKeychain ] spawnKeychain = safeSpawn "urxvt" $ ["-e", "keychain"] ++ keys -- cgit v1.2.3 From 6b2f1ba42459b7a3b62502baab88997613178d7e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:55:31 +0200 Subject: =?UTF-8?q?Dropped=20support=20for=20arbitrary=20user=20shell=20to?= =?UTF-8?q?=20please=20p=C3=B6ttering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/systemd/user/emacs.service | 4 ++-- .config/systemd/user/urxvtd.service | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/systemd/user/emacs.service b/.config/systemd/user/emacs.service index 9f9e4f9..a552611 100644 --- a/.config/systemd/user/emacs.service +++ b/.config/systemd/user/emacs.service @@ -3,8 +3,8 @@ Description=Emacs: the extensible, self-documenting text editor [Service] Type=forking -ExecStart=%s -c "emacs --daemon" -ExecStop=%s -c 'emacsclient --eval "(kill-emacs)"' +ExecStart=/bin/sh -c "emacs --daemon" +ExecStop=/bin/sh -c 'emacsclient --eval "(kill-emacs)"' Environment=PATH=%h/bin:/var/setuid-wrappers:%h/.nix-profile/bin:%h/.nix-profile/sbin:%h/.nix-profile/lib/kde4/libexec:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/nix/var/nix/profiles/default/lib/kde4/libexec:/run/current-system/sw/bin:/run/current-system/sw/sbin:/run/current-system/sw/lib/kde4/libexec Restart=always diff --git a/.config/systemd/user/urxvtd.service b/.config/systemd/user/urxvtd.service index 4efe794..c5ff9b9 100644 --- a/.config/systemd/user/urxvtd.service +++ b/.config/systemd/user/urxvtd.service @@ -3,7 +3,7 @@ Description=urxvtd - urxvt terminal daemon [Service] Type=simple -ExecStart=%s -c urxvtd +ExecStart=/bin/sh -c urxvtd Restart=always [Install] -- cgit v1.2.3 From 5262d988777e45cb76a53da781bab4242594516b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 23:05:49 +0200 Subject: =?UTF-8?q?Removed=20=C2=BBautostart=C2=AB=20entries=20for=20syste?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/systemd/user/default.target.wants/emacs.service | 1 - .config/systemd/user/default.target.wants/urxvtd.service | 1 - 2 files changed, 2 deletions(-) delete mode 120000 .config/systemd/user/default.target.wants/emacs.service delete mode 120000 .config/systemd/user/default.target.wants/urxvtd.service diff --git a/.config/systemd/user/default.target.wants/emacs.service b/.config/systemd/user/default.target.wants/emacs.service deleted file mode 120000 index ae565e2..0000000 --- a/.config/systemd/user/default.target.wants/emacs.service +++ /dev/null @@ -1 +0,0 @@ -/home/gkleen/.config/systemd/user/emacs.service \ No newline at end of file diff --git a/.config/systemd/user/default.target.wants/urxvtd.service b/.config/systemd/user/default.target.wants/urxvtd.service deleted file mode 120000 index a0216ce..0000000 --- a/.config/systemd/user/default.target.wants/urxvtd.service +++ /dev/null @@ -1 +0,0 @@ -/home/gkleen/.config/systemd/user/urxvtd.service \ No newline at end of file -- cgit v1.2.3 From 640d38abbc4302d08721624f49d56641af751ab4 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 23:16:39 +0200 Subject: nix-mode, keychain-environment, mic-paren --- .emacs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.emacs b/.emacs index 438b60f..d7de207 100644 --- a/.emacs +++ b/.emacs @@ -29,7 +29,7 @@ Return a list of installed packages or nil for every skipped package." (or (file-exists-p package-user-dir) (package-refresh-contents)) -(ensure-package-installed 'color-theme 'evil 'evil-dvorak 'undo-tree 'zenburn-theme 'magit 'haskell-mode) +(ensure-package-installed 'color-theme 'evil 'evil-dvorak 'undo-tree 'zenburn-theme 'magit 'haskell-mode 'keychain-environment 'nix-mode 'mic-paren) (package-initialize) -- cgit v1.2.3 From ef6720c055c91c75b1f00467bbcead6ff52d23d5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 23:21:36 +0200 Subject: Emacs keybinding for xmonad on vali --- .xmonad/xmonad.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 0687afb..91af611 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -79,7 +79,8 @@ hostFromName h@("vali") = defaultHost { hName = h , hWsp = hWsp , hCoWsp = hCoWsp , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) - ] + (xK_e, ["emacsclient", "-c"]) + ] , hScreens = [1, 0] ++ [2,3..] } where -- cgit v1.2.3 From f730cf5e57ae33ddef1b74c2ee9a9386e51e9ea8 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 23:23:38 +0200 Subject: , --- .xmonad/xmonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 91af611..1deaabf 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -79,7 +79,7 @@ hostFromName h@("vali") = defaultHost { hName = h , hWsp = hWsp , hCoWsp = hCoWsp , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) - (xK_e, ["emacsclient", "-c"]) + , (xK_e, ["emacsclient", "-c"]) ] , hScreens = [1, 0] ++ [2,3..] } -- cgit v1.2.3 From 7e14dc64630e39adf884f229a57b5431fec434a5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 23:24:57 +0200 Subject: semantic fix --- .xmonad/xmonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 1deaabf..35112a5 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -79,7 +79,7 @@ hostFromName h@("vali") = defaultHost { hName = h , hWsp = hWsp , hCoWsp = hCoWsp , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) - , (xK_e, ["emacsclient", "-c"]) + , (xK_e, ["emacsclient -c"]) ] , hScreens = [1, 0] ++ [2,3..] } -- cgit v1.2.3 From 8f0c21a828f9f2b854f5850b454a3b0b76476493 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 16 Jul 2015 19:29:03 +0200 Subject: Moved urxvtd back into xmonad; Fixed spawnKeychain in xmonad --- .config/systemd/user/urxvtd.service | 10 ---------- .xmonad/xmonad.hs | 11 ++++++++--- 2 files changed, 8 insertions(+), 13 deletions(-) delete mode 100644 .config/systemd/user/urxvtd.service diff --git a/.config/systemd/user/urxvtd.service b/.config/systemd/user/urxvtd.service deleted file mode 100644 index c5ff9b9..0000000 --- a/.config/systemd/user/urxvtd.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=urxvtd - urxvt terminal daemon - -[Service] -Type=simple -ExecStart=/bin/sh -c urxvtd -Restart=always - -[Install] -WantedBy=default.target diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 35112a5..621d1e1 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -40,6 +40,9 @@ import Control.Monad (when) import Graphics.X11.ExtraTypes.XF86 import XMonad.Util.Cursor import XMonad.Actions.Warp +import XMonad.Util.SpawnOnce +import System.Directory +import System.FilePath import XMonad.Layout.IM @@ -164,11 +167,13 @@ main = do xmonad $ myConfig autostart = [ spawnKeychain + , spawnOnce "urxvtd -o" ] -spawnKeychain = safeSpawn "urxvt" $ ["-e", "keychain"] ++ keys - where - keys = map ("~/.ssh/id_" ++) ["ed25519", "ecdsa", "rsa"] +spawnKeychain = do + home <- liftIO getHomeDirectory + let keys = map ((home ) . ("/.ssh/id_" ++)) ["ed25519", "ecdsa", "rsa"] + safeSpawn "urxvt" $ ["-e", "keychain"] ++ keys assimilateKeychain :: X () assimilateKeychain = liftIO $ assimilateKeychain' >> return () -- cgit v1.2.3 From e62a346d035773783ae0ce72963f9bdfb5a03601 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 16 Jul 2015 19:33:04 +0200 Subject: Managing keychain terminal like scratchpad --- .xmonad/xmonad.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 621d1e1..ab3bc4c 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -109,7 +109,7 @@ spawnBindings conf (k, cmds) = zipWith (\m cmd -> ((modm .|. mod1Mask .|. m, k), where modm = XMonad.modMask conf -manageScratchTerm = resource =? "scratchpad" -?> doRectFloat $ RationalRect (1 % 16) (1 % 16) (7 % 8) (7 % 8) +manageScratchTerm = (resource =? "scratchpad" <||> resource =? "keysetup") -?> doRectFloat $ RationalRect (1 % 16) (1 % 16) (7 % 8) (7 % 8) tabbedLayout t = renamed [Replace "Tabbed"] $ reflectHoriz $ t CustomShrink $ tabbedTheme tabbedTheme = defaultTheme { activeColor = "black" @@ -173,7 +173,7 @@ autostart = [ spawnKeychain spawnKeychain = do home <- liftIO getHomeDirectory let keys = map ((home ) . ("/.ssh/id_" ++)) ["ed25519", "ecdsa", "rsa"] - safeSpawn "urxvt" $ ["-e", "keychain"] ++ keys + safeSpawn "urxvt" $ ["-title", "keysetup", "-e", "keychain"] ++ keys assimilateKeychain :: X () assimilateKeychain = liftIO $ assimilateKeychain' >> return () -- cgit v1.2.3 From 4a30327944eed71d936836d05c665aa58afad85b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 16 Jul 2015 20:05:06 +0200 Subject: Tweaks to haskell-mode --- .emacs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.emacs b/.emacs index d7de207..c35c552 100644 --- a/.emacs +++ b/.emacs @@ -66,9 +66,17 @@ Return a list of installed packages or nil for every skipped package." kept-old-versions 2 version-control t) +(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) +(eval-after-load "haskell-mode" + '(progn + (define-key haskell-mode-map (kbd "C-,") 'haskell-move-nested-lift) + (define-key haskell-mode-map (kbd "C-.") 'haskell-move-nested-right))) + (custom-set-variables '(haskell-font-lock-symbols t)) -(custom-set-faces - '(font-lock-type-face ((t (:foreground "PaleGreen" :weight bold)))) - '(font-lock-function-face ((t (:foreground "LightSkyBlue" :weight bold)))) - ) +(add-hook 'haskell-mode-hook + (custom-set-faces + '(font-lock-type-face ((t (:foreground "PaleGreen" :weight bold)))) + '(font-lock-function-face ((t (:foreground "LightSkyBlue" :weight bold)))) + ) + ) -- cgit v1.2.3 From 48cd5862c2982ec6f48d086e8683d486588e3f4f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 13 Sep 2015 22:13:34 +0200 Subject: Switched from broken dwb to chromium on vali --- .xmonad/xmonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index ab3bc4c..353041d 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -81,7 +81,7 @@ hostFromName h@("vali") = defaultHost { hName = h ] , hWsp = hWsp , hCoWsp = hCoWsp - , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["dwb", "dwb $(xclip -o)"]) + , hKeysMod = \conf -> Map.union $ Map.fromList $ join $ map (spawnBindings conf) [ (xK_d, ["chromium", "chromium $(xclip -o)"]) , (xK_e, ["emacsclient -c"]) ] , hScreens = [1, 0] ++ [2,3..] -- cgit v1.2.3