summaryrefslogtreecommitdiff
path: root/batteryarc-widget/batteryarc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'batteryarc-widget/batteryarc.lua')
-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+)')