dotfiles/de/home/.config/eww/modules/bar/battery.yuck
2025-03-05 17:00:02 -08:00

22 lines
684 B
Text

(defvar reveal_battery false)
(defwidget battery []
(revealer-on-hover
:revealvar reveal_battery
:revealvar-name "reveal_battery"
(button :onclick 'pavucontrol-qt --tab 3'
{(EWW_BATTERY.BAT0.status == "Charging") ? " ${EWW_BATTERY.BAT0.capacity}%" : " ${EWW_BATTERY.BAT0.capacity}%"})
(battery_children)))
(defpoll battery_level :initial 0
:interval "1s"
"scripts/battery-status")
(defwidget battery_children []
(box :class "reveal_children"
:orientation "h"
:space-evenly false
:halign "center"
(progress
:height 10
:valign "center"
:value {EWW_BATTERY.BAT0.capacity}
:orientation "h")))