Fixes #134, caused by a divide by zero error on systems with no batteries
This commit is contained in:
parent
0b463d427f
commit
050b62a20a
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user