summaryrefslogtreecommitdiff
path: root/battery-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2020-04-02 22:22:16 -0400
committerstreetturtle <streetturtle@gmail.com>2020-04-02 22:22:16 -0400
commit6bee8b688009ee35f6098abe9e5aee37c8a69b1c (patch)
tree4cd7198dc98541cd5de525453f9b596f56ed097b /battery-widget
parent1a04a94838292793f571ed2ddbfb3bdbfaa3b631 (diff)
parent02914db0f21e08380ebf34c293ec7c970edcac45 (diff)
Merge branch 'master' of github.com:streetturtle/awesome-wm-widgets
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+)')