Show battery power draw from sensors in waybar

Replace the built-in battery module with a custom/battery script that
combines sysfs capacity/status with the power1 reading from `sensors`,
displaying it as "85% (5.4W)" next to the icon.
This commit is contained in:
2026-08-22 13:43:19 +00:00
parent 3d3717d0fb
commit 9170828b36
3 changed files with 46 additions and 5 deletions
+3 -3
View File
@@ -12,9 +12,9 @@ window#waybar { background: @bg; color: @text; }
#workspaces button.focused { color: @bg; background: @blue; }
#workspaces button.focused:hover { background: @blue; color: @bg; }
#workspaces button.urgent { background: @blue-dark; color: @text; }
#mode, #clock, #cpu, #memory, #custom-network, #pulseaudio, #backlight, #battery, #tray, #custom-power { padding: 0 10px; margin: 4px 2px; background: transparent; border-radius: 6px; }
#mode:hover, #clock:hover, #cpu:hover, #memory:hover, #custom-network:hover, #pulseaudio:hover, #backlight:hover, #battery:hover, #tray:hover, #custom-power:hover { background: @surface; }
#mode, #clock, #cpu, #memory, #custom-network, #pulseaudio, #backlight, #custom-battery, #tray, #custom-power { padding: 0 10px; margin: 4px 2px; background: transparent; border-radius: 6px; }
#mode:hover, #clock:hover, #cpu:hover, #memory:hover, #custom-network:hover, #pulseaudio:hover, #backlight:hover, #custom-battery:hover, #tray:hover, #custom-power:hover { background: @surface; }
#clock { color: @blue; font-weight: bold; background: transparent; }
#cpu, #memory { color: @text; }
#custom-power { color: @blue; font-size: 16px; }
#battery.warning, #battery.critical { color: @blue; }
#custom-battery.warning, #custom-battery.critical { color: @blue; }