mirror of
https://github.com/streetturtle/awesome-wm-widgets.git
synced 2024-11-17 07:49:09 +01:00
Merge pull request #108 from umar456/fix_regex
Remove extra branch that broke when "rate information unavailable"
This commit is contained in:
commit
f76542848c
1 changed files with 2 additions and 4 deletions
|
@ -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+)')
|
||||
|
|
Loading…
Reference in a new issue