From e6993dd131272de5d88fdbed112bc89207414e09 Mon Sep 17 00:00:00 2001 From: azhi Date: Thu, 26 Mar 2020 22:34:46 +0300 Subject: fix battery widget remove extra branch that broke acpi output with 'rate informration unavailable' same fix as 95cc9b94 (#108) for batteryarc widget --- battery-widget/battery.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'battery-widget') diff --git a/battery-widget/battery.lua b/battery-widget/battery.lua index b47794d..c066fcc 100644 --- a/battery-widget/battery.lua +++ b/battery-widget/battery.lua @@ -115,10 +115,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+)') -- cgit v1.2.3