diff options
author | streetturtle <streetturtle@users.noreply.github.com> | 2019-03-05 08:54:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-05 08:54:51 -0500 |
commit | f24cbb9fa524241caa6b66c7891ad0e7b157e883 (patch) | |
tree | f1cd28e9acfbce22d0ce6c726b80f69445d972b8 | |
parent | 38a43f816f3f6d106d947235e6034f0babac1192 (diff) | |
parent | 82c052ceecb59e2023c4b6f336e0db9423529a02 (diff) |
Merge pull request #71 from andyhelp/master
batteryarc-widget: fix crash when battery is not available
-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 |