From f7e5b10c543ad47515cb50c839bb6fb3273d7938 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sun, 26 Jul 2026 00:24:33 +0530 Subject: 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 --- modules/desktop/waybar/module/battery.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'modules/desktop/waybar/module/battery.nix') 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 = "{icon} {capacity}%"; - format-charging = "󰂄 {capacity}%"; - format-plugged = "󰁹 {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; "󰁾" "󰁿" "󰂀" - "󰂁" + "󰁂" "󰂂" "󰁹" ]; -- cgit v1.2.3