diff options
author | jao <jao@gnu.org> | 2022-03-05 01:03:50 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-03-05 01:03:50 +0000 |
commit | 6b594ef5f2e364448de0c11b5ac0535cf47f90f1 (patch) | |
tree | e07b05dcdd55e6bea7ec6f8db8d2c4adeba95591 | |
parent | 2ac800e6ca58a9d104ea3f5319729fe9bf9fc2a7 (diff) | |
download | xmobar-config-6b594ef5f2e364448de0c11b5ac0535cf47f90f1.tar.gz xmobar-config-6b594ef5f2e364448de0c11b5ac0535cf47f90f1.tar.bz2 |
capture window manager in palette
-rw-r--r-- | src/lib/Config.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/Config.hs b/src/lib/Config.hs index d9a3084..22b077e 100644 --- a/src/lib/Config.hs +++ b/src/lib/Config.hs @@ -21,6 +21,7 @@ data Palette = Palette { pNormal :: String , pAlpha :: Int , pIconRoot :: String , pIsLight :: Bool + , pWm :: Maybe String } fc color thing = "<fc=" ++ color ++ ">" ++ thing ++ "</fc>" @@ -44,6 +45,7 @@ lightPalette = Palette { pNormal = "#000000" , pAlpha = 229 , pIconRoot = icons "light" , pIsLight = True + , pWm = Nothing } zenburnRed = "#CC9393" @@ -72,12 +74,15 @@ darkPalette = Palette { pNormal = zenburnFg , pAlpha = 255 , pIconRoot = icons "dark" , pIsLight = False + , pWm = Nothing } palette :: IO Palette palette = do light <- lightTheme - if light then return lightPalette else return darkPalette + wm <- lookupEnv "WM" + let p = if light then lightPalette else darkPalette + return $ p {pWm = wm} baseConfig :: Palette -> Config baseConfig p = defaultConfig { |