aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/waybar/module/network.nix
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-26 00:24:33 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-26 00:24:33 +0530
commitf7e5b10c543ad47515cb50c839bb6fb3273d7938 (patch)
tree1507c1c1a5bc1ba8a0b04883fce1a4c8f8bd8dfb /modules/desktop/waybar/module/network.nix
parent2f64a2097812c1820766909037e724f3415c7576 (diff)
downloadhome-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/network.nix')
-rw-r--r--modules/desktop/waybar/module/network.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/desktop/waybar/module/network.nix b/modules/desktop/waybar/module/network.nix
index fb1e836..7f0af4c 100644
--- a/modules/desktop/waybar/module/network.nix
+++ b/modules/desktop/waybar/module/network.nix
@@ -1,11 +1,14 @@
-{ config, iconColor }:
+{ config, mkIcon }:
with config.scheme.withHashtag;
+let
+ iconColor = base0B;
+in
{
interval = 2;
- format-wifi = "<span foreground='${iconColor}'>{icon}</span> 󰁅{bandwidthDownBytes} 󰁝{bandwidthUpBytes}";
- format-ethernet = "<span foreground='${iconColor}'></span> 󰁅{bandwidthDownBytes} 󰁝{bandwidthUpBytes}";
- format-disconnected = "<span foreground='${iconColor}'>󰤮</span> Disconnected";
+ format-wifi = "${mkIcon iconColor "{icon}"} 󰁅{bandwidthDownBytes} 󰁝{bandwidthUpBytes}";
+ format-ethernet = "${mkIcon iconColor ""} 󰁅{bandwidthDownBytes} 󰁝{bandwidthUpBytes}";
+ format-disconnected = "${mkIcon iconColor "󰤮"} Disconnected";
tooltip-format = "{ifname}";
tooltip-format-wifi = "{essid} ({signalStrength}%)";