eww: fix handling of no battery connected

This commit is contained in:
Simon Gardling 2025-11-16 01:29:36 -05:00
parent ef6d2e2179
commit bbb342af4d
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -93,10 +93,11 @@
(defpoll time :interval "1s" `date +'{"long":"%a %b %e %H:%M:%S %Z %Y","hour":"%H","minute":"%M"}'`) (defpoll time :interval "1s" `date +'{"long":"%a %b %e %H:%M:%S %Z %Y","hour":"%H","minute":"%M"}'`)
; TODO: make this a package or something, not using rust-script ; TODO: make this a package or something, not using rust-script
(defpoll powerstats :interval "2s" `~/Documents/power_bat.rs`) (defpoll powerstats :interval "2s" :run-while {EWW_BATTERY["BAT1"] != ""} `~/Documents/power_bat.rs`)
(defwidget battery [] (defwidget battery []
(box :space-evenly false (box :space-evenly false
:visible {EWW_BATTERY["BAT1"] != ""}
:tooltip powerstats :tooltip powerstats
(label (label
:text {EWW_BATTERY.BAT1.status == "Charging" ? "󰂄" : :text {EWW_BATTERY.BAT1.status == "Charging" ? "󰂄" :