diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-26 00:24:33 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-26 00:24:33 +0530 |
| commit | f7e5b10c543ad47515cb50c839bb6fb3273d7938 (patch) | |
| tree | 1507c1c1a5bc1ba8a0b04883fce1a4c8f8bd8dfb /modules/desktop/waybar/module/battery.nix | |
| parent | 2f64a2097812c1820766909037e724f3415c7576 (diff) | |
| download | home-manager-config-f7e5b10c543ad47515cb50c839bb6fb3273d7938.tar.gz home-manager-config-f7e5b10c543ad47515cb50c839bb6fb3273d7938.zip | |
refactor(waybar): extract mkIcon helper, drop per-module iconColor parameter
- Add lib.nix with shared mkIcon function for consistent icon formatting
- Pass mkIcon instead of per-module iconColor to all modules
- Define iconColor locally within each module
- Fix battery icon character
Diffstat (limited to 'modules/desktop/waybar/module/battery.nix')
| -rw-r--r-- | modules/desktop/waybar/module/battery.nix | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/desktop/waybar/module/battery.nix b/modules/desktop/waybar/module/battery.nix index e9b8186..05ae449 100644 --- a/modules/desktop/waybar/module/battery.nix +++ b/modules/desktop/waybar/module/battery.nix @@ -1,9 +1,12 @@ -{ config, iconColor }: +{ config, mkIcon }: with config.scheme.withHashtag; +let + iconColor = base09; +in { - format = "<span foreground='${iconColor}'>{icon}</span> {capacity}%"; - format-charging = "<span foreground='${iconColor}'></span> {capacity}%"; - format-plugged = "<span foreground='${iconColor}'></span> {capacity}%"; + format = "${mkIcon iconColor "{icon}"} {capacity}%"; + format-charging = "${mkIcon iconColor ""} {capacity}%"; + format-plugged = "${mkIcon iconColor ""} {capacity}%"; format-alt = "{time} {icon}"; format-icons = [ "" @@ -13,7 +16,7 @@ with config.scheme.withHashtag; "" "" "" - "" + "" "" "" ]; |
