Merge pull request #37 from Tyilo/patch-1

Support one-digit charges in battery widget
This commit is contained in:
streetturtle 2018-03-21 09:56:51 -04:00 committed by GitHub
commit 74f3d82bdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ end
watch("acpi", 10,
function(widget, stdout, stderr, exitreason, exitcode)
local batteryType
local _, status, charge_str, time = string.match(stdout, '(.+): (%a+), (%d?%d%d)%%,? ?.*')
local _, status, charge_str, time = string.match(stdout, '(.+): (%a+), (%d?%d?%d)%%,? ?.*')
local charge = tonumber(charge_str)
if (charge >= 0 and charge < 15) then
batteryType = "battery-empty%s-symbolic"