summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2018-12-19 21:18:58 -0500
committerstreetturtle <streetturtle@gmail.com>2018-12-19 21:18:58 -0500
commit855677d667875e301fc519e77bf998964f6db4a3 (patch)
tree1c588974e1a807e94ccc5661c190552e9f878376
parent293916e80faa4705b2f67ef98589d73e4d961ac2 (diff)
possible fix for #62
-rw-r--r--batteryarc-widget/batteryarc.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/batteryarc-widget/batteryarc.lua b/batteryarc-widget/batteryarc.lua
index 6b28c46..517401b 100644
--- a/batteryarc-widget/batteryarc.lua
+++ b/batteryarc-widget/batteryarc.lua
@@ -48,7 +48,9 @@ watch("acpi -i", 10,
local capacities = {}
for s in stdout:gmatch("[^\r\n]+") do
local status, charge_str, time = string.match(s, '.+: (%a+), (%d?%d?%d)%%,?.*')
- if status ~= nil then
+ if string.match(s, 'rate information') then
+ -- ignore such line
+ elseif status ~= nil then
table.insert(battery_info, {status = status, charge = tonumber(charge_str)})
else
local cap_str = string.match(s, '.+:.+last full capacity (%d+)')