Fixes #134, caused by a divide by zero error on systems with no batteries

This commit is contained in:
Sean E. Russell 2020-06-23 07:12:09 -05:00
parent 0b463d427f
commit 050b62a20a

View File

@ -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"