diff --git a/widgets/batterygauge.go b/widgets/batterygauge.go index 135f223..02a8866 100644 --- a/widgets/batterygauge.go +++ b/widgets/batterygauge.go @@ -51,6 +51,10 @@ func (b *BatteryGauge) update() { } return } + if len(bats) < 1 { + b.Label = fmt.Sprintf("N/A") + return + } mx := 0.0 cu := 0.0 charging := "%d%% ⚡%s"