Seperate theme files, Xmobar major changes.

This commit is contained in:
ramazanemreosmanoglu 2022-10-26 10:59:51 +03:00
parent 1fcc67c8f2
commit f70f93141f
4 changed files with 48 additions and 28 deletions

View file

@ -1,3 +1,8 @@
Config { bgColor = "#425F57" Config { bgColor = "#425F57"
, fgColor = "#CFFF8D" , fgColor = "#CFFF8D"
, template = "%XMonadPropRead%"} , font = "xft:iosevka-9"
, commands = [ Run Date "%a %Y-%m-%d <fc=#8be9fd>%H:%M</fc>" "date" 10
, Run XMonadLog
]
, alignSep = "}{"
, template = " %XMonadLog% }{ %date% "}

View file

@ -0,0 +1,17 @@
module NaturalGreenTheme (naturalGreenTheme) where
import Theme (Theme(..))
import XMonad.Hooks.StatusBar.PP
naturalGreenXmobarPP :: PP
naturalGreenXmobarPP = def
{ ppSep = ""
}
naturalGreenTheme :: Theme
naturalGreenTheme = Theme { themeName = "Natural Green"
, themeBarConfig = "~/.config/xmobar/natural-green-xmobarrc"
, themeBorderColor = "#425F57"
, themeFocusedBorderColor = "#749F82"
, themeWallpaper = "~/Wallpapers/wp-hs.png"
, themeXmobarPP = naturalGreenXmobarPP
}

View file

@ -0,0 +1,10 @@
module Theme ( Theme(..) ) where
import XMonad.Hooks.StatusBar.PP
data Theme = Theme { themeName :: String
, themeBarConfig :: String
, themeBorderColor :: String
, themeFocusedBorderColor :: String
, themeWallpaper :: String
, themeXmobarPP :: PP
}

View file

@ -6,9 +6,14 @@ import XMonad.Hooks.StatusBar.PP
import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.EwmhDesktops
import XMonad.Util.SpawnOnce (spawnOnce) import XMonad.Util.SpawnOnce (spawnOnce)
import Theme
import NaturalGreenTheme
main = do main = do
xmonad . ewmhFullscreen . ewmh . xmobarProp $ def xmonad . ewmhFullscreen . ewmh . withEasySB (statusBarProp ("xmobar " ++ themeWallpaper myTheme) (pure $ themeXmobarPP myTheme)) defToggleStrutsKey $ myConfig
{ terminal = myTerminal
myConfig = def { terminal = myTerminal
, modMask = myModMask , modMask = myModMask
, borderWidth = myBorderWidth , borderWidth = myBorderWidth
, focusedBorderColor = themeFocusedBorderColor myTheme , focusedBorderColor = themeFocusedBorderColor myTheme
@ -17,7 +22,6 @@ main = do
} }
`additionalKeysP` myKeybindings `additionalKeysP` myKeybindings
myTerminal = "alacritty" myTerminal = "alacritty"
myModMask = mod4Mask myModMask = mod4Mask
myBorderWidth = 5 myBorderWidth = 5
@ -27,7 +31,7 @@ myTheme = naturalGreenTheme
myStartupHook :: X () myStartupHook :: X ()
myStartupHook = do myStartupHook = do
spawnOnce $ "/usr/bin/xmobar " ++ themeBarConfig myTheme spawn $ "/usr/bin/xmobar " ++ themeBarConfig myTheme
spawn $ "feh --bg-scale " ++ themeWallpaper myTheme spawn $ "feh --bg-scale " ++ themeWallpaper myTheme
myKeybindings :: [(String, X())] myKeybindings :: [(String, X())]
@ -39,19 +43,3 @@ myKeybindings = [ ("M-e", spawn myEmacs)
, ("<XF86AudioLowerVolume>", spawn "amixer -q sset Master 3%-") , ("<XF86AudioLowerVolume>", spawn "amixer -q sset Master 3%-")
, ("M-<Return>", spawn myTerminal) , ("M-<Return>", spawn myTerminal)
] ]
-- Themes
data Theme = Theme { themeName :: String
, themeBarConfig :: String
, themeBorderColor :: String
, themeFocusedBorderColor :: String
, themeWallpaper :: String
}
naturalGreenTheme :: Theme
naturalGreenTheme = Theme { themeName = "Natural Green"
, themeBarConfig = "~/.config/xmobar/natural-green-xmobarrc"
, themeBorderColor = "#425F57"
, themeFocusedBorderColor = "#749F82"
, themeWallpaper = "~/Wallpapers/wp-hs.png"
}