summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/xmonad
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/xmonad')
-rw-r--r--accounts/gkleen@sif/xmonad/package.yaml1
-rw-r--r--accounts/gkleen@sif/xmonad/xmonad-yggdrasil.nix4
-rw-r--r--accounts/gkleen@sif/xmonad/xmonad.hs57
3 files changed, 36 insertions, 26 deletions
diff --git a/accounts/gkleen@sif/xmonad/package.yaml b/accounts/gkleen@sif/xmonad/package.yaml
index 48de1a53..f65137af 100644
--- a/accounts/gkleen@sif/xmonad/package.yaml
+++ b/accounts/gkleen@sif/xmonad/package.yaml
@@ -23,6 +23,7 @@ executables:
23 - containers 23 - containers
24 - hostname 24 - hostname
25 - libnotify 25 - libnotify
26 - taffybar
26 27
27 main: xmonad.hs 28 main: xmonad.hs
28 source-dirs: 29 source-dirs:
diff --git a/accounts/gkleen@sif/xmonad/xmonad-yggdrasil.nix b/accounts/gkleen@sif/xmonad/xmonad-yggdrasil.nix
index d3d72310..7c853619 100644
--- a/accounts/gkleen@sif/xmonad/xmonad-yggdrasil.nix
+++ b/accounts/gkleen@sif/xmonad/xmonad-yggdrasil.nix
@@ -1,7 +1,7 @@
1{ mkDerivation, aeson, base, bytestring, containers, directory 1{ mkDerivation, aeson, base, bytestring, containers, directory
2, filepath, hostname, hpack, mtl, network, parsec, process, lib 2, filepath, hostname, hpack, mtl, network, parsec, process, lib
3, temporary, transformers, unix, utf8-string, X11, xmonad 3, temporary, transformers, unix, utf8-string, X11, xmonad
4, xmonad-contrib, libnotify 4, xmonad-contrib, libnotify, taffybar
5}: 5}:
6mkDerivation { 6mkDerivation {
7 pname = "xmonad-yggdrasil"; 7 pname = "xmonad-yggdrasil";
@@ -13,7 +13,7 @@ mkDerivation {
13 executableHaskellDepends = [ 13 executableHaskellDepends = [
14 aeson base bytestring containers directory filepath hostname mtl 14 aeson base bytestring containers directory filepath hostname mtl
15 network parsec process temporary transformers unix utf8-string X11 15 network parsec process temporary transformers unix utf8-string X11
16 xmonad xmonad-contrib libnotify 16 xmonad xmonad-contrib libnotify taffybar
17 ]; 17 ];
18 preConfigure = "hpack"; 18 preConfigure = "hpack";
19 license = "unknown"; 19 license = "unknown";
diff --git a/accounts/gkleen@sif/xmonad/xmonad.hs b/accounts/gkleen@sif/xmonad/xmonad.hs
index aba245ff..c642a3a7 100644
--- a/accounts/gkleen@sif/xmonad/xmonad.hs
+++ b/accounts/gkleen@sif/xmonad/xmonad.hs
@@ -75,6 +75,8 @@ import qualified XMonad.Actions.PhysicalScreens as P
75 75
76import XMonad.Layout.IM 76import XMonad.Layout.IM
77 77
78import System.Taffybar.Support.PagerHints (pagerHints)
79
78import XMonad.Prompt.MyShell 80import XMonad.Prompt.MyShell
79import XMonad.Prompt.MyPass 81import XMonad.Prompt.MyPass
80import XMonad.Prompt.MySsh 82import XMonad.Prompt.MySsh
@@ -142,6 +144,12 @@ defaultHost = Host { hName = "unkown"
142browser :: String 144browser :: String
143browser = "env MOZ_USE_XINPUT2=1 firefox" 145browser = "env MOZ_USE_XINPUT2=1 firefox"
144 146
147gray, darkGray, red, green :: String
148gray = "#808080"
149darkGray = "#202020"
150red = "#800000"
151green = "#008000"
152
145hostFromName :: HostName -> Host 153hostFromName :: HostName -> Host
146hostFromName h@("vali") = defaultHost { hName = h 154hostFromName h@("vali") = defaultHost { hName = h
147 , hManageHook = composeOne $ catMaybes [ Just manageScratchTerm 155 , hManageHook = composeOne $ catMaybes [ Just manageScratchTerm
@@ -222,7 +230,7 @@ hostFromName h
222 , hCoWsp = hCoWsp 230 , hCoWsp = hCoWsp
223 , hKeysMod = \conf -> Map.union $ (Map.fromList $ join $ map (spawnBindings conf) [ (xK_e, ["emacsclient -c"]) 231 , hKeysMod = \conf -> Map.union $ (Map.fromList $ join $ map (spawnBindings conf) [ (xK_e, ["emacsclient -c"])
224 , (xK_d, [fromString browser, "google-chrome", "notmuch-links"]) 232 , (xK_d, [fromString browser, "google-chrome", "notmuch-links"])
225 , (xK_c, [ inputPrompt xPConfig "dc" ?+ dc ]) 233 , (xK_c, [ inputPrompt xPConfigMonospace "dc" ?+ dc ])
226 , (xK_g, ["pidgin"]) 234 , (xK_g, ["pidgin"])
227 , (xK_s, ["skype"]) 235 , (xK_s, ["skype"])
228 -- , (xK_p, [mkPassPrompt "Type password" pwType xPConfig, mkPassPrompt "Show password" pwShow xPConfig, mkPassPrompt "Copy password" pwClip xPConfig]) 236 -- , (xK_p, [mkPassPrompt "Type password" pwType xPConfig, mkPassPrompt "Show password" pwShow xPConfig, mkPassPrompt "Copy password" pwClip xPConfig])
@@ -240,10 +248,10 @@ hostFromName h
240 , "emacsclient -c -F \"'(title . \\\"Mail\\\")\" -e \"(browse-url-mail \"$(xclip -o)\")\"" 248 , "emacsclient -c -F \"'(title . \\\"Mail\\\")\" -e \"(browse-url-mail \"$(xclip -o)\")\""
241 ]) 249 ])
242 , (xK_Return, ["keynav start,windowzoom", "keynav start"]) 250 , (xK_Return, ["keynav start,windowzoom", "keynav start"])
243 , (xK_t, [inputPrompt xPConfig "fuzzytime timer" ?+ fuzzytime, fuzzytime "unset", work_fuzzytime]) 251 , (xK_t, [inputPrompt xPConfigMonospace "fuzzytime timer" ?+ fuzzytime, fuzzytime "unset", work_fuzzytime])
244 , (xK_a, [inputPrompt xPConfig "adjmix" ?+ adjmix]) 252 , (xK_a, [inputPrompt xPConfigMonospace "adjmix" ?+ adjmix])
245 , (xK_s, [ inputPromptWithCompl xPConfig "start synergy" synergyCompl ?+ synergyStart 253 , (xK_s, [ inputPromptWithCompl xPConfigMonospace "start synergy" synergyCompl ?+ synergyStart
246 , inputPromptWithCompl xPConfig "stop synergy" synergyCompl ?+ synergyStop 254 , inputPromptWithCompl xPConfigMonospace "stop synergy" synergyCompl ?+ synergyStop
247 ]) 255 ])
248 , (xK_h, [ "alacritty --class htop -e htop" 256 , (xK_h, [ "alacritty --class htop -e htop"
249 , "alacritty --class log -e journalctl -xef" 257 , "alacritty --class log -e journalctl -xef"
@@ -447,14 +455,14 @@ tabbedTheme = def
447 { activeColor = "black" 455 { activeColor = "black"
448 , inactiveColor = "black" 456 , inactiveColor = "black"
449 , urgentColor = "black" 457 , urgentColor = "black"
450 , activeBorderColor = "grey" 458 , activeBorderColor = gray
451 , inactiveBorderColor = "#202020" 459 , inactiveBorderColor = darkGray
452 , urgentBorderColor = "#bb0000" 460 , urgentBorderColor = red
453 , activeTextColor = "grey" 461 , activeTextColor = gray
454 , inactiveTextColor = "grey" 462 , inactiveTextColor = gray
455 , urgentTextColor = "grey" 463 , urgentTextColor = gray
456 , decoHeight = 32 464 , decoHeight = 32
457 , fontName = "xft:Fira Mono for Powerline:style=Medium:pixelsize=22.5" 465 , fontName = "xft:Fira Sans:pixelsize=21"
458 } 466 }
459 467
460main :: IO () 468main :: IO ()
@@ -477,7 +485,7 @@ main = do
477 let 485 let
478 host = hostFromName hostname 486 host = hostFromName hostname
479 setEnv "HOST" hostname 487 setEnv "HOST" hostname
480 let myConfig = withHostUrgency . ewmh $ docks def 488 let myConfig = withHostUrgency . ewmh . pagerHints $ docks def
481 { manageHook = hManageHook host 489 { manageHook = hManageHook host
482 , terminal = "alacritty" 490 , terminal = "alacritty"
483 , layoutHook = smartBorders . avoidStruts $ windowNavigation layout' 491 , layoutHook = smartBorders . avoidStruts $ windowNavigation layout'
@@ -488,8 +496,8 @@ main = do
488 , keys = \conf -> hKeysMod host conf $ myKeys' conf host 496 , keys = \conf -> hKeysMod host conf $ myKeys' conf host
489 , workspaces = take (length numKeys) $ map wsp [1..] 497 , workspaces = take (length numKeys) $ map wsp [1..]
490 , startupHook = setDefaultCursor xC_left_ptr 498 , startupHook = setDefaultCursor xC_left_ptr
491 , normalBorderColor = "#202020" 499 , normalBorderColor = darkGray
492 , focusedBorderColor = "grey" 500 , focusedBorderColor = gray
493 , handleEventHook = fullscreenEventHook <+> (serverModeEventHookCmd' $ hCmds host) <+> keyUpEventHook 501 , handleEventHook = fullscreenEventHook <+> (serverModeEventHookCmd' $ hCmds host) <+> keyUpEventHook
494 } 502 }
495 writeProps str = do 503 writeProps str = do
@@ -562,7 +570,7 @@ main = do
562 _ -> id 570 _ -> id
563 urgencyHook' window = do 571 urgencyHook' window = do
564 runQuery ((resource =? "comm" <||> resource =? "Pidgin" <||> className =? "Gajim" <||> className =? "Skype") --> safeSpawn "thinklight" ["Blink", "100"]) window 572 runQuery ((resource =? "comm" <||> resource =? "Pidgin" <||> className =? "Gajim" <||> className =? "Skype") --> safeSpawn "thinklight" ["Blink", "100"]) window
565 urgencyHook (BorderUrgencyHook { urgencyBorderColor = "#bb0000" }) window 573 urgencyHook (BorderUrgencyHook { urgencyBorderColor = red }) window
566 shutdown :: SomeException -> IO a 574 shutdown :: SomeException -> IO a
567 shutdown e = do 575 shutdown e = do
568 let pids = [ -- batteryMon 576 let pids = [ -- batteryMon
@@ -666,18 +674,19 @@ instance Shrinker CustomShrink where
666 | length cs >= 4 = cs : shrinkIt s ((reverse . drop 4 . reverse $ cs) ++ "...") 674 | length cs >= 4 = cs : shrinkIt s ((reverse . drop 4 . reverse $ cs) ++ "...")
667 | otherwise = cs : shrinkIt s (init cs) 675 | otherwise = cs : shrinkIt s (init cs)
668 676
669xPConfig :: XPConfig 677xPConfig, xPConfigMonospace :: XPConfig
670xPConfig = def 678xPConfig = def
671 { font = "xft:Fira Mono for Powerline:style=Medium:pixelsize=22.5" 679 { font = "xft:Fira Sans:pixelsize=21"
672 , height = 32 680 , height = 32
673 , bgColor = "black" 681 , bgColor = "black"
674 , fgColor = "grey" 682 , fgColor = gray
675 , fgHLight = "green" 683 , fgHLight = green
676 , bgHLight = "black" 684 , bgHLight = "black"
677 , borderColor = "grey" 685 , borderColor = gray
678 , searchPredicate = (\needle haystack -> all (`isInfixOf` map toLower haystack) . map (map toLower) $ words needle) 686 , searchPredicate = (\needle haystack -> all (`isInfixOf` map toLower haystack) . map (map toLower) $ words needle)
679 , position = Top 687 , position = Top
680 } 688 }
689xPConfigMonospace = xPConfig { font = "xft:Fira Code:pixelsize=21" }
681 690
682sshOverrides host = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux host} ) 691sshOverrides host = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux host} )
683 [ "odin" 692 [ "odin"
@@ -767,9 +776,9 @@ myKeys' conf host = Map.fromList $
767 776
768 -- launch dmenu 777 -- launch dmenu
769 --, ((modm, xK_d ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") 778 --, ((modm, xK_d ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
770 , ((modm, xK_d ), shellPrompt "Run: " xPConfig) 779 , ((modm, xK_d ), shellPrompt "Run: " xPConfigMonospace)
771 , ((modm .|. shiftMask, xK_d ), prompt "Run in Terminal: " ("alacritty" ++ " -e") xPConfig) 780 , ((modm .|. shiftMask, xK_d ), prompt "Run in Terminal: " ("alacritty" ++ " -e") xPConfigMonospace)
772 , ((modm, xK_at ), sshPrompt (sshOverrides . Just $ hName host) xPConfig) 781 , ((modm, xK_at ), sshPrompt (sshOverrides . Just $ hName host) xPConfigMonospace)
773 782
774 -- close focused window 783 -- close focused window
775 , ((modm .|. shiftMask, xK_q ), kill) 784 , ((modm .|. shiftMask, xK_q ), kill)