From 1fcc67c8f27a6538d012275c733b7de7c757e308 Mon Sep 17 00:00:00 2001 From: ramazanemreosmanoglu Date: Wed, 26 Oct 2022 08:16:54 +0300 Subject: [PATCH] Theming mechanism for xmonad. --- .config/xmobar/natural-green-xmobarrc | 3 +++ .config/xmonad/xmonad.hs | 28 ++++++++++++++++++++------- .xmobarrc | 1 - 3 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 .config/xmobar/natural-green-xmobarrc delete mode 100644 .xmobarrc diff --git a/.config/xmobar/natural-green-xmobarrc b/.config/xmobar/natural-green-xmobarrc new file mode 100644 index 0000000..22969f1 --- /dev/null +++ b/.config/xmobar/natural-green-xmobarrc @@ -0,0 +1,3 @@ +Config { bgColor = "#425F57" + , fgColor = "#CFFF8D" + , template = "%XMonadPropRead%"} diff --git a/.config/xmonad/xmonad.hs b/.config/xmonad/xmonad.hs index 9cac4a7..2d41e56 100644 --- a/.config/xmonad/xmonad.hs +++ b/.config/xmonad/xmonad.hs @@ -11,8 +11,8 @@ main = do { terminal = myTerminal , modMask = myModMask , borderWidth = myBorderWidth - , focusedBorderColor = myFocusedBorderColor - , normalBorderColor = myNormalBorderColor + , focusedBorderColor = themeFocusedBorderColor myTheme + , normalBorderColor = themeBorderColor myTheme , startupHook = myStartupHook } `additionalKeysP` myKeybindings @@ -23,14 +23,12 @@ myModMask = mod4Mask myBorderWidth = 5 myEmacs = "emacsclient -c -a 'emacs' " myBrowser = "firefox" -myFocusedBorderColor = "#749F82" -myNormalBorderColor = "#425F57" -myWallpaper = "/home/reo/Videos/wp-hs.png" +myTheme = naturalGreenTheme myStartupHook :: X () myStartupHook = do - spawnOnce "/usr/bin/xmobar" - spawn $ "feh --bg-scale " ++ myWallpaper + spawnOnce $ "/usr/bin/xmobar " ++ themeBarConfig myTheme + spawn $ "feh --bg-scale " ++ themeWallpaper myTheme myKeybindings :: [(String, X())] myKeybindings = [ ("M-e", spawn myEmacs) @@ -41,3 +39,19 @@ myKeybindings = [ ("M-e", spawn myEmacs) , ("", spawn "amixer -q sset Master 3%-") , ("M-", 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" + } diff --git a/.xmobarrc b/.xmobarrc deleted file mode 100644 index df30135..0000000 --- a/.xmobarrc +++ /dev/null @@ -1 +0,0 @@ -Config {template = "%XMonadPropRead%"}