Theming mechanism for xmonad.

This commit is contained in:
ramazanemreosmanoglu 2022-10-26 08:16:54 +03:00
parent 1911a6b0f7
commit 1fcc67c8f2
3 changed files with 24 additions and 8 deletions

View file

@ -0,0 +1,3 @@
Config { bgColor = "#425F57"
, fgColor = "#CFFF8D"
, template = "%XMonadPropRead%"}

View file

@ -11,8 +11,8 @@ main = do
{ terminal = myTerminal { terminal = myTerminal
, modMask = myModMask , modMask = myModMask
, borderWidth = myBorderWidth , borderWidth = myBorderWidth
, focusedBorderColor = myFocusedBorderColor , focusedBorderColor = themeFocusedBorderColor myTheme
, normalBorderColor = myNormalBorderColor , normalBorderColor = themeBorderColor myTheme
, startupHook = myStartupHook , startupHook = myStartupHook
} }
`additionalKeysP` myKeybindings `additionalKeysP` myKeybindings
@ -23,14 +23,12 @@ myModMask = mod4Mask
myBorderWidth = 5 myBorderWidth = 5
myEmacs = "emacsclient -c -a 'emacs' " myEmacs = "emacsclient -c -a 'emacs' "
myBrowser = "firefox" myBrowser = "firefox"
myFocusedBorderColor = "#749F82" myTheme = naturalGreenTheme
myNormalBorderColor = "#425F57"
myWallpaper = "/home/reo/Videos/wp-hs.png"
myStartupHook :: X () myStartupHook :: X ()
myStartupHook = do myStartupHook = do
spawnOnce "/usr/bin/xmobar" spawnOnce $ "/usr/bin/xmobar " ++ themeBarConfig myTheme
spawn $ "feh --bg-scale " ++ myWallpaper spawn $ "feh --bg-scale " ++ themeWallpaper myTheme
myKeybindings :: [(String, X())] myKeybindings :: [(String, X())]
myKeybindings = [ ("M-e", spawn myEmacs) myKeybindings = [ ("M-e", spawn myEmacs)
@ -41,3 +39,19 @@ 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"
}

View file

@ -1 +0,0 @@
Config {template = "%XMonadPropRead%"}