diff options
Diffstat (limited to 'batteryarc-widget')
-rw-r--r-- | batteryarc-widget/batteryarc.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/batteryarc-widget/batteryarc.lua b/batteryarc-widget/batteryarc.lua index a8e5250..1727ee1 100644 --- a/batteryarc-widget/batteryarc.lua +++ b/batteryarc-widget/batteryarc.lua @@ -75,7 +75,9 @@ watch("acpi -i", 10, charge = charge + batt.charge * capacities[i] end - charge = charge / capacity + if capacity > 0 then + charge = charge / capacity + end widget.value = charge / 100 if status == 'Charging' then |