summaryrefslogtreecommitdiffstats
path: root/widgets/batterygauge.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/batterygauge.go')
-rw-r--r--widgets/batterygauge.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/widgets/batterygauge.go b/widgets/batterygauge.go
index 20d92d4..3a89590 100644
--- a/widgets/batterygauge.go
+++ b/widgets/batterygauge.go
@@ -49,7 +49,6 @@ func (b *BatteryGauge) update() {
log.Printf("error setting up batteries: %v", err)
errLogged = true
}
- return
}
if len(bats) < 1 {
b.Label = fmt.Sprintf("N/A")
@@ -60,6 +59,9 @@ func (b *BatteryGauge) update() {
charging := "%d%% ⚡%s"
rate := 0.0
for _, bat := range bats {
+ if bat.Full == 0.0 {
+ continue
+ }
mx += bat.Full
cu += bat.Current
if rate < bat.ChargeRate {