From 176e4be1e399461596794c6f4f785f1fcccd937d Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 18 Sep 2024 07:52:35 +0100 Subject: [PATCH] Update styling for waybar battery module Add colours based on state (low, critical, charging) Increase module verbosity with lower battery, add time estimate when charging Add power draw to tooltip format --- system/home/waybar/default.nix | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/system/home/waybar/default.nix b/system/home/waybar/default.nix index 3db17fb6..35e108d8 100644 --- a/system/home/waybar/default.nix +++ b/system/home/waybar/default.nix @@ -222,13 +222,16 @@ }; battery = { states = { - warning = 30; - critical = 20; + warning = 20; + critical = 10; }; format = "{icon}"; - format-charging = "󰂄 "; + format-time = "{H}:{m}"; + format-charging = "󰂄 ({time})"; format-plugged = "󰚥 "; - tooltip-format = "{capacity}% {time}"; + format-warning = "{icon}{capacity}%"; + format-critical = "{icon}{capacity}% ({time})"; + tooltip-format = "{capacity}% | {power}W | {time}"; format-icons = [ "󱃍 " "󰁺 " @@ -376,6 +379,17 @@ #clock { color: ${sc.base0D}; } + + #battery.warning { + color: ${sc.base09}; + } + #battery.critical { + color: ${sc.base08}; + } + #battery.charging, + #battery.plugged { + color: ${sc.base0B}; + } ''; }; }