diff --git a/user/wm/xmonad/lib/Colors/Stylix.hs.mustache b/user/wm/xmonad/lib/Colors/Stylix.hs.mustache
index 9083527..d5ff51d 100644
--- a/user/wm/xmonad/lib/Colors/Stylix.hs.mustache
+++ b/user/wm/xmonad/lib/Colors/Stylix.hs.mustache
@@ -4,15 +4,15 @@ import XMonad
colorBg = "#{{base00-hex}}"
colorFg = "#{{base05-hex}}"
-colorBlack = "#{{base01-hex}}"
-colorRed = "#{{base08-hex}}"
-colorGreen = "#{{base0B-hex}}"
-colorYellow = "#{{base0A-hex}}"
-colorBlue = "#{{base0E-hex}}"
-colorMagenta = "#{{base0F-hex}}"
-colorCyan = "#{{base01-hex}}"
-colorWhite = "#{{base07-hex}}"
+color01 = "#{{base01-hex}}" -- usually black
+color02 = "#{{base08-hex}}" -- usually red
+color03 = "#{{base0B-hex}}" -- usually green
+color04 = "#{{base0A-hex}}" -- usually yellow
+color05 = "#{{base0E-hex}}" -- usually blue
+color06 = "#{{base0F-hex}}" -- usually magenta
+color07 = "#{{base0D-hex}}" -- usually cyan
+color08 = "#{{base07-hex}}" -- usually white
-- Select focus and secondary color
-colorFocus = colorRed
-colorSecondary = colorCyan
+colorFocus = color02
+colorSecondary = color07
diff --git a/user/wm/xmonad/xmobarrc.mustache b/user/wm/xmonad/xmobarrc.mustache
new file mode 100644
index 0000000..9c85836
--- /dev/null
+++ b/user/wm/xmonad/xmobarrc.mustache
@@ -0,0 +1,44 @@
+Config { font = "Inconsolata 18"
+ , additionalFonts = ["Symbols Nerd Font 14"]
+ , border = NoBorder
+ , bgColor = "#{{base00-hex}}"
+ , alpha = 200
+ , fgColor = "#{{base05-hex}}"
+ , position = TopSize C 100 28
+ , textOffset = -1
+ , iconOffset = -1
+ , lowerOnStart = True
+ , pickBroadest = False
+ , persistent = False
+ , hideOnStart = False
+ , iconRoot = "."
+ , allDesktops = True
+ , overrideRedirect = True
+ , commands = [
+ Run XMonadLog
+ , Run Date " \xf073 %a %-m/%-d/%y %-I:%M:%S%P" "date" 10
+ , Run BatteryP ["BAT0"]
+ ["-t", "",
+ "-L", "10", "-H", "80", "-p", "3", "--",
+ "-O","\xf313 \xf17e3% ",
+ "-i","\xf313 \xf17e7% ",
+ "-o","\xf313 \xf17e4% ",
+ "-L", "-15", "-H", "-5",
+ "-l", "#{{base08-hex}}", "-m", "#{{base05-hex}}", "-h", "#{{base0B-hex}}"] 10
+ , Run Brightness
+ [ "-t", "\xf0eb % ", "--",
+ "-D", "amdgpu_bl1"
+ ] 2
+ , Run Volume "default" "Master"
+ [ "-t", "", "--"
+ , "--on", " \xf028 % "
+ , "--onc", "#{{base0D-hex}}"
+ , "--off", " \xf026 Mute "
+ , "--offc", "#{{base0F-hex}}"
+ ] 1
+ ]
+ , sepChar = "%"
+ , alignSep = "}{"
+ , template = " %battery% %bright%%default:Master%}%XMonadLog%{%date% "
+ }
+}
diff --git a/user/wm/xmonad/xmonad.nix b/user/wm/xmonad/xmonad.nix
index 8144768..a1ed2ca 100644
--- a/user/wm/xmonad/xmonad.nix
+++ b/user/wm/xmonad/xmonad.nix
@@ -5,7 +5,6 @@
imports = [ ../picom/picom.nix ];
home.file.".config/xmonad/xmonad.hs".source = ./xmonad.hs;
- home.file.".config/xmobar/base-xmobarrc".source = ./base-xmobarrc;
home.file.".config/xmonad/startup.sh".source = ./startup.sh;
home.file.".config/xmonad/lib/Colors/Stylix.hs".source = config.lib.stylix.colors {
@@ -13,6 +12,11 @@
extension = ".hs";
};
+ home.file.".config/xmobar/xmobarrc".source = config.lib.stylix.colors {
+ template = builtins.readFile ./xmobarrc.mustache;
+ extension = "";
+ };
+
home.packages = with pkgs; [
xmobar
dunst
diff --git a/user/wm/xmonad/xmonad.org b/user/wm/xmonad/xmonad.org
index 05db6b1..0d94eae 100644
--- a/user/wm/xmonad/xmonad.org
+++ b/user/wm/xmonad/xmonad.org
@@ -48,6 +48,28 @@ import XMonad.Util.SpawnOnce
#+END_SRC
** Theme Setup
+*** Custom Color Library Template
+#+BEGIN_SRC haskell :tangle ./lib/Colors/Stylix.hs.mustache
+module Colors.Stylix where
+
+import XMonad
+
+colorBg = "#{{base00-hex}}"
+colorFg = "#{{base05-hex}}"
+color01 = "#{{base01-hex}}" -- usually black
+color02 = "#{{base08-hex}}" -- usually red
+color03 = "#{{base0B-hex}}" -- usually green
+color04 = "#{{base0A-hex}}" -- usually yellow
+color05 = "#{{base0E-hex}}" -- usually blue
+color06 = "#{{base0F-hex}}" -- usually magenta
+color07 = "#{{base0D-hex}}" -- usually cyan
+color08 = "#{{base07-hex}}" -- usually white
+
+-- Select focus and secondary color
+colorFocus = color02
+colorSecondary = color07
+
+#+END_SRC
*** Import Custom Color Library
#+BEGIN_SRC haskell :tangle xmonad.hs
-- setup color variables
@@ -695,18 +717,16 @@ main = do
}
#+END_SRC
* XMobar Config
-I utilize xmobar as a status bar on my monitors. To manage my xmobar configs, three main files are used:
-- [[./base-xmobarrc][base-xmobarrc]] which contains the structure of my xmobar config
-- [[./startup.sh][startup.sh]] which has a section which generates a copy of my xmobarrcs for the current color scheme I set in [[./xmonad.hs][xmonad.hs]]
-** Base xmobarrc
+I utilize xmobar as a status bar on my monitors. To manage my xmobar config, I start by creating a template file, and then style that using stylix.
+** Xmobar Template
This is my base xmobarrc. This is a full xmobar config with placeholders for the colors (i.e. =colorFgNormal=, =colorBgNormal=, =color01Normal=, =color01Bright=, etc...). [[./startup.sh][startup.sh]] copies this into =xmobarrc= with my current base16 color scheme. This also depends on =Inconsolata= and =Symbols Nerd Font=.
-#+BEGIN_SRC haskell :tangle base-xmobarrc
+#+BEGIN_SRC haskell :tangle xmobarrc.mustache
Config { font = "Inconsolata 18"
, additionalFonts = ["Symbols Nerd Font 14"]
, border = NoBorder
- , bgColor = "colorBgNormal"
+ , bgColor = "#{{base00-hex}}"
, alpha = 200
- , fgColor = "colorFgNormal"
+ , fgColor = "#{{base05-hex}}"
, position = TopSize C 100 28
, textOffset = -1
, iconOffset = -1
@@ -719,30 +739,30 @@ Config { font = "Inconsolata 18"
, overrideRedirect = True
, commands = [
Run XMonadLog
- , Run Date " \xf073 %a %-m/%-d/%y %-I:%M:%S%P" "date" 10
+ , Run Date " \xf073 %a %-m/%-d/%y %-I:%M:%S%P" "date" 10
, Run BatteryP ["BAT0"]
["-t", "",
"-L", "10", "-H", "80", "-p", "3", "--",
- "-O","\xf313 \xf17e3% ",
- "-i","\xf313 \xf17e7% ",
- "-o","\xf313 \xf17e4% ",
+ "-O","\xf313 \xf17e3% ",
+ "-i","\xf313 \xf17e7% ",
+ "-o","\xf313 \xf17e4% ",
"-L", "-15", "-H", "-5",
- "-l", "color02Normal", "-m", "color05Normal", "-h", "color03Normal"] 10
+ "-l", "#{{base08-hex}}", "-m", "#{{base05-hex}}", "-h", "#{{base0B-hex}}"] 10
, Run Brightness
- [ "-t", "\xf0eb % ", "--",
+ [ "-t", "\xf0eb % ", "--",
"-D", "amdgpu_bl1"
] 2
, Run Volume "default" "Master"
[ "-t", "", "--"
- , "--on", " \xf028 % "
- , "--onc", "color07Normal"
- , "--off", " \xf026 Mute "
- , "--offc", "color06Normal"
+ , "--on", " \xf028 % "
+ , "--onc", "#{{base0D-hex}}"
+ , "--off", " \xf026 Mute "
+ , "--offc", "#{{base0F-hex}}"
] 1
]
, sepChar = "%"
, alignSep = "}{"
- , template = " %battery% %bright%%default:Master%}%XMonadLog%{%date% "
+ , template = " %battery% %bright%%default:Master%}%XMonadLog%{%date% "
}
}
@@ -757,7 +777,6 @@ In order to have Nix put my xmonad/xmobar configuration in the proper places, I
imports = [ ../picom/picom.nix ];
home.file.".config/xmonad/xmonad.hs".source = ./xmonad.hs;
- home.file.".config/xmobar/base-xmobarrc".source = ./base-xmobarrc;
home.file.".config/xmonad/startup.sh".source = ./startup.sh;
home.file.".config/xmonad/lib/Colors/Stylix.hs".source = config.lib.stylix.colors {
@@ -765,6 +784,11 @@ In order to have Nix put my xmonad/xmobar configuration in the proper places, I
extension = ".hs";
};
+ home.file.".config/xmobar/xmobarrc".source = config.lib.stylix.colors {
+ template = builtins.readFile ./xmobarrc.mustache;
+ extension = "";
+ };
+
home.packages = with pkgs; [
xmobar
dunst