batteryarc-widget: fix crash when battery is not available
It was crashing awesome window manager when starting with battery removed from the laptop.
This commit is contained in:
parent
38a43f816f
commit
82c052ceec
|
@ -75,7 +75,9 @@ watch("acpi -i", 10,
|
|||
|
||||
charge = charge + batt.charge * capacities[i]
|
||||
end
|
||||
if capacity > 0 then
|
||||
charge = charge / capacity
|
||||
end
|
||||
|
||||
widget.value = charge / 100
|
||||
if status == 'Charging' then
|
||||
|
|
Loading…
Reference in New Issue