diff options
author | Umar Arshad <umar@arrayfire.com> | 2020-01-13 14:25:24 -0500 |
---|---|---|
committer | Umar Arshad <umar@arrayfire.com> | 2020-01-13 14:25:24 -0500 |
commit | 95cc9b942297b8f0cd16b1eb4d336a5e5643681e (patch) | |
tree | 9f08a81f85d46546379b256461fa15469f6461ef | |
parent | 428b32d6ea3d1f67babe309879d953a9353bb45a (diff) |
Remove extra branch that broke when "rate information unavailable"
-rw-r--r-- | batteryarc-widget/batteryarc.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/batteryarc-widget/batteryarc.lua b/batteryarc-widget/batteryarc.lua index 0078164..dce483a 100644 --- a/batteryarc-widget/batteryarc.lua +++ b/batteryarc-widget/batteryarc.lua @@ -68,10 +68,8 @@ local function worker(args) local battery_info = {} local capacities = {} for s in stdout:gmatch("[^\r\n]+") do - local status, charge_str, time = string.match(s, '.+: (%a+), (%d?%d?%d)%%,?.*') - if string.match(s, 'rate information') then - -- ignore such line - elseif status ~= nil then + local status, charge_str, time = string.match(s, '.+: (%a+), (%d?%d?%d)%%,?(.*)') + if status ~= nil then table.insert(battery_info, { status = status, charge = tonumber(charge_str) }) else local cap_str = string.match(s, '.+:.+last full capacity (%d+)') |