(defvar reveal_battery false)
(defwidget battery []
  (revealer-on-hover
    :revealvar reveal_battery
    :revealvar-name "reveal_battery"
    (button :onclick 'notify-send battery lol'
            :class {(EWW_BATTERY == "" || jq(EWW_BATTERY,'.[].status?') == '"Charging"') ? "active" : "" }
;            :tooltip "${jq(EWW_BATTERY,'.[].capacity?')}%"
;      {(EWW_BATTERY == "") ? "" : `${(jq(EWW_BATTERY,'.[].status?') == '"Charging"') ? " ${jq(EWW_BATTERY,'.[].capacity?')}%" : " ${jq(EWW_BATTERY,'.[].capacity?')}%"}`})
      `${(EWW_BATTERY == "" || jq(EWW_BATTERY,'.[].status?') == '"Charging"') ? "" : ""}${(EWW_BATTERY == "") ? "" : "${jq(EWW_BATTERY,'.[].capacity?')}%"}`)
    (battery_children)))
; ${jq(EWW_BATTERY,'.[].capacity?')}%"}
(defwidget battery_children []
  (box :class "reveal_children"
    :orientation "h"
    :space-evenly false
    :halign "center"
    (progress
      :height 10
      :valign "center"
      :value {(EWW_BATTERY == "") ? 100 : jq(EWW_BATTERY,'.[].capacity?')}
      :orientation "h")))
