fix battery widget
remove extra branch that broke acpi output with 'rate informration unavailable'
same fix as 95cc9b94
(#108) for batteryarc widget
This commit is contained in:
parent
d2bbf765fa
commit
e6993dd131
|
@ -115,10 +115,8 @@ local function worker(args)
|
||||||
local battery_info = {}
|
local battery_info = {}
|
||||||
local capacities = {}
|
local capacities = {}
|
||||||
for s in stdout:gmatch("[^\r\n]+") do
|
for s in stdout:gmatch("[^\r\n]+") do
|
||||||
local status, charge_str, time = string.match(s, '.+: (%a+), (%d?%d?%d)%%,?.*')
|
local status, charge_str, time = string.match(s, '.+: (%a+), (%d?%d?%d)%%,?(.*)')
|
||||||
if string.match(s, 'rate information') then
|
if status ~= nil then
|
||||||
-- ignore such line
|
|
||||||
elseif status ~= nil then
|
|
||||||
table.insert(battery_info, {status = status, charge = tonumber(charge_str)})
|
table.insert(battery_info, {status = status, charge = tonumber(charge_str)})
|
||||||
else
|
else
|
||||||
local cap_str = string.match(s, '.+:.+last full capacity (%d+)')
|
local cap_str = string.match(s, '.+:.+last full capacity (%d+)')
|
||||||
|
|
Loading…
Reference in New Issue