summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/xmonad/xmonad.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-12-05 16:56:41 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2021-12-05 16:58:32 +0100
commite019e80eac1b03a5c177ef5d358b720bdbc774ac (patch)
treef2d86a62a62af8f2233c80c115b4943a379996dc /accounts/gkleen@sif/xmonad/xmonad.hs
parent73875ac457ec19f1cabb3d343e0c44c1b1171f3d (diff)
downloadnixos-e019e80eac1b03a5c177ef5d358b720bdbc774ac.tar
nixos-e019e80eac1b03a5c177ef5d358b720bdbc774ac.tar.gz
nixos-e019e80eac1b03a5c177ef5d358b720bdbc774ac.tar.bz2
nixos-e019e80eac1b03a5c177ef5d358b720bdbc774ac.tar.xz
nixos-e019e80eac1b03a5c177ef5d358b720bdbc774ac.zip
gkleen@sif: taffybar
Diffstat (limited to 'accounts/gkleen@sif/xmonad/xmonad.hs')
-rw-r--r--accounts/gkleen@sif/xmonad/xmonad.hs57
1 files changed, 33 insertions, 24 deletions
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)