diff options
author | Andreas Longo <git@andreaslongo.com> | 2022-02-15 18:03:08 +0100 |
---|---|---|
committer | Andreas Longo <git@andreaslongo.com> | 2022-02-15 22:10:13 +0100 |
commit | 51ddb1efba57b4c41addd3a00b87bce2c2443741 (patch) | |
tree | 9629a6c94fc86c4b0a6c5d4b1c239d09abf8d7c6 /battery-widget | |
parent | 3975a9d01b0dd6125d1828ea2a471ac1cd9bd397 (diff) |
Fix #209: Match space characters in battery status string
Diffstat (limited to 'battery-widget')
-rw-r--r-- | battery-widget/battery.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/battery-widget/battery.lua b/battery-widget/battery.lua index fc8c56f..ed44d5c 100644 --- a/battery-widget/battery.lua +++ b/battery-widget/battery.lua @@ -125,7 +125,7 @@ local function worker(user_args) local battery_info = {} local capacities = {} for s in stdout:gmatch("[^\r\n]+") do - local status, charge_str, _ = string.match(s, '.+: (%a+), (%d?%d?%d)%%,?(.*)') + local status, charge_str, _ = string.match(s, '.+: ([%a%s]+), (%d?%d?%d)%%,?(.*)') if status ~= nil then table.insert(battery_info, {status = status, charge = tonumber(charge_str)}) else |