diff --git a/config/waybar.css b/config/waybar.css index d739333..68d1fb5 100644 --- a/config/waybar.css +++ b/config/waybar.css @@ -83,6 +83,22 @@ window#waybar.floating #window { color: @teal; } +#battery { + color: @green; +} + +#battery.charging { + color: @green; +} + +#battery.warning:not(.charging) { + color: @peach; +} + +#battery.critical:not(.charging) { + color: @maroon; +} + #pulseaudio { color: @pink; } diff --git a/modules/desktop/waybar.nix b/modules/desktop/waybar.nix index e1eb147..0e619e8 100644 --- a/modules/desktop/waybar.nix +++ b/modules/desktop/waybar.nix @@ -52,6 +52,7 @@ in { "cpu" "memory" "power-profiles-daemon" + "battery" #"network" ]; }; @@ -166,6 +167,19 @@ in { format = " {percentage}%"; tooltip-format = "{used:0.1f}GiB/{avail:0.1f}GiB used\n{swapUsed:0.1f}GiB/{swapAvail:0.1f}GiB swap"; }; + battery = { + interval = 30; + states = { + warning = 20; + critical = 10; + }; + full-at = 98; + format = "{icon} {capacity}%"; + format-icons = ["" "" "" "" ""]; + format-critical = " {capacity}%"; + tooltip-format = "{timeTo} ({power}W)"; + format-charging = " {capacity}%"; + }; clock = { format = "{:%H:%M}"; format-alt = "{:%a %b %d %R}";