summaryrefslogtreecommitdiff
path: root/battery-widget
diff options
context:
space:
mode:
authorazhi <azhi@users.noreply.github.com>2020-03-26 22:34:46 +0300
committerGitHub <noreply@github.com>2020-03-26 22:34:46 +0300
commite6993dd131272de5d88fdbed112bc89207414e09 (patch)
tree5111fab21ed9e1cc0b437356a0303ce6279fd960 /battery-widget
parentd2bbf765faffdb5628edbae3b169f3f6fcdad356 (diff)
fix battery widget
remove extra branch that broke acpi output with 'rate informration unavailable' same fix as 95cc9b94 (#108) for batteryarc widget
Diffstat (limited to 'battery-widget')
-rw-r--r--battery-widget/battery.lua6
1 files changed, 2 insertions, 4 deletions
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+)')