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

25 lines
847 B
Text

(defvar reveal_battery false)
(defwidget battery []
(revealer-on-hover
:class {(EWW_BATTERY != "")? "active" : ""}
:revealvar reveal_battery
:revealvar-name "reveal_battery"
(button :onclick 'notify-send battery lol'
; {jq(EWW_BATTERY,'.[].status?')})
; "${jq(EWW_BATTERY,'.total_avg')}")
{(jq(EWW_BATTERY,'.[].status?') == '"Charging"') ? " ${jq(EWW_BATTERY,'.[].capacity?')}%" : " ${jq(EWW_BATTERY,'.[].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 {jq(EWW_BATTERY,'.[].capacity?')}
:orientation "h")))