diff options
Diffstat (limited to 'xmonad.hs')
| -rw-r--r-- | xmonad.hs | 100 |
1 files changed, 48 insertions, 52 deletions
@@ -1,10 +1,11 @@ {-# OPTIONS_HADDOCK prune #-} -{-# OPTIONS_GHC -Wno-deprecations #-} ---------------------------------------------------------------------- -- | -- Description : la-ninpre xmonad config -- Maintainer : la-ninpre +-- License : ISC +-- Copyright : la-ninpre <aaoth AT aaoth DOT xyz> -- -- personal xmonad config. based heavily on distrotube's config. -- i've added some stuff and toki pona fonts @@ -123,9 +124,9 @@ myWindowCountLogger = gets $ Just . show . length . W.integrate' . W.stack -- -- $gridSelect -- --- this section provides theming of @GridSelect@ stuff. +-- this section provides theming of 'GridSelect' stuff. -- --- here, @GridSelect@ is used for following things: +-- here, 'GridSelect' is used for following things: -- -- * spawning some frequently used programs -- @@ -133,37 +134,30 @@ myWindowCountLogger = gets $ Just . show . length . W.integrate' . W.stack -- -- * bringing the desired window to the current workspace --- | custom colorizer that colors windows based on their class -myColorizer :: Window -> Bool -> X (String, String) -myColorizer = colorRangeFromClassName - (0x00,0x00,0x00) -- lowest inactive bg - (0xbd,0x9c,0xf9) -- highest inactive bg - (0xc7,0x92,0xea) -- active bg - (0xc0,0xa7,0x9a) -- inactive fg - (0x28,0x2c,0x34) -- active fg - --- | gridSelect config -myGridConfig :: p -> GSConfig Window -myGridConfig colorizer = (buildDefaultGSConfig myColorizer) +-- | custom colorizer for 'gridselect' +-- +-- essentially, it is just plain theme +myColorizer :: a -> Bool -> X (String, String) +myColorizer _ active = if active then return (col_bg_alt def, col_fg_alt def) + else return (col_bg def, col_fg def) + +-- | custom 'GSConfig' +myGridConfig :: GSConfig a +myGridConfig = (buildDefaultGSConfig myColorizer) { gs_cellheight = 40 , gs_cellwidth = 200 , gs_cellpadding = 6 , gs_originFractX = 0.5 , gs_originFractY = 0.5 + , gs_bordercolor = col_bg_alt def , gs_font = head myFonts } -- | spawn selected programs with grid select -spawnSelected' :: [(String, String)] -> X () -spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn - where conf = def - { gs_cellheight = 40 - , gs_cellwidth = 200 - , gs_cellpadding = 6 - , gs_originFractX = 0.5 - , gs_originFractY = 0.5 - , gs_font = head myFonts - } +-- +-- it is esentially the same as 'spawnSelected' but allows to specify program aliases +mySpawnSelected :: [(String, String)] -> X () +mySpawnSelected lst = gridselect myGridConfig lst >>= flip whenJust spawn -- * layouts -- @@ -171,7 +165,7 @@ spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn -- -- $spacingHelpers -- --- theese are making calls to spacingRaw simpler to write +-- these make calls to 'spacingRaw' simpler to write -- | for many windows mySpacing :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a @@ -215,15 +209,18 @@ threeCol = renamed [Replace "threeCol"] $ ThreeColMid 1 (3/100) (1/2) -- | setting colors for tabs layout and tabs sublayout. -myTabTheme = def - { fontName = head myFonts - , activeColor = myColor "gray4" - , inactiveColor = myColor "gray0" - , activeBorderColor = myColor "gray4" - , inactiveBorderColor = myColor "gray0" - , activeTextColor = myColor "bg" - , inactiveTextColor = myColor "fg" - } +myTabTheme :: Theme +myTabTheme = def { fontName = head myFonts + , activeTextColor = col_fg_alt def + , activeColor = col_bg_alt def + , activeBorderWidth = 0 + , inactiveTextColor = col_fg def + , inactiveColor = col_bg def + , inactiveBorderWidth = 0 + , urgentTextColor = col_bg_alt def + , urgentColor = col_fg_alt def + , urgentBorderWidth = 0 + } -- ** layout hook @@ -249,8 +246,8 @@ myShowWNameTheme :: SWNConfig myShowWNameTheme = def { swn_font = myFonts !! 1 , swn_fade = 0.7 - , swn_bgcolor = myColor "bg" - , swn_color = myColor "fg" + , swn_bgcolor = col_bg def + , swn_color = col_fg def } -- * workspaces @@ -337,9 +334,9 @@ myKeys = , ("C-M1-l", incScreenSpacing 4) -- Increase screen spacing -- Grid Select (MOD-g followed by a key) - , ("M-g g", spawnSelected' myAppGrid) -- grid select favorite apps - , ("M-g t", goToSelected $ myGridConfig myColorizer) -- goto selected window - , ("M-g b", bringSelected $ myGridConfig myColorizer) -- bring selected window + , ("M-g g", mySpawnSelected myAppGrid) -- grid select favorite apps + , ("M-g t", goToSelected myGridConfig) -- goto selected window + , ("M-g b", bringSelected myGridConfig) -- bring selected window -- Windows navigation , ("M-m", windows W.focusMaster) -- Move focus to the master window @@ -412,11 +409,10 @@ myKeys = , ("<XF86AudioPrev>", spawn (myMocp ++ " --previous")) , ("<XF86AudioNext>", spawn (myMocp ++ " --next")) , ("<XF86AudioMute>", spawn (myMocp ++ " -v 0")) - , ("<XF86AudioLowerVolume>", spawn (myMocp ++ " -v -1")) - , ("<XF86AudioRaiseVolume>", spawn (myMocp ++ " -v +1")) - , ("<XF86HomePage>", spawn "brave https://aaoth.xyz") - , ("<XF86Search>", spawn "dm-websearch") - , ("<XF86Mail>", runOrRaise "geary" (resource =? "geary")) + , ("<XF86AudioLowerVolume>", spawn (myMocp ++ " -v -5")) + , ("<XF86AudioRaiseVolume>", spawn (myMocp ++ " -v +5")) + , ("<XF86HomePage>", spawn "firefox https://aaoth.xyz") + , ("<XF86Mail>", runOrRaise "thunderbird" (resource =? "thunderbird")) , ("<XF86Calculator>", namedScratchpadAction myScratchPads "calculator") , ("<XF86Sleep>", spawn "dm-logout") ] @@ -445,20 +441,20 @@ main = do $ namedScratchpadFilterOutWorkspacePP $ xmobarPP { ppOutput = hPutStrLn xmproc - , ppCurrent = xmobarColor (myColor "green-bright") "" + , ppCurrent = xmobarColor (col_fg_alt def) "" . wrap "<fn=3>" "</fn>" -- toki pona . wrap "[" "]" -- . wrap " " " " -- normal - , ppVisible = xmobarColor (myColor "green-bright") "" . clickable - , ppHidden = xmobarColor (myColor "blue-bright") "" + , ppVisible = xmobarColor (col_fg_alt def) "" . clickable + , ppHidden = xmobarColor (col_fg def) "" . wrap "" "'" . clickable - , ppHiddenNoWindows = xmobarColor (myColor "gray2") "" . clickable + , ppHiddenNoWindows = xmobarColor (col_bg_alt def) "" . clickable --, ppHiddenNoWindows = myHiddenNoWindows - , ppTitle = xmobarColor (myColor "gray4") "" . shorten 60 - , ppSep = xmobarColor (myColor "gray3") "" " | " + , ppTitle = xmobarColor (col_fg def) "" . shorten 60 + , ppSep = xmobarColor (col_bg_alt def) "" " | " , ppWsSep = " " - , ppUrgent = xmobarColor (myColor "yellow") "" . wrap "!" "!" + , ppUrgent = xmobarColor (col_fg_alt def) "" . wrap "!" "!" , ppExtras = [myWindowCountLogger] , ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t] } |
