From dfe693ce4f369eefd951119b463c8fcccf5ae119 Mon Sep 17 00:00:00 2001 From: Asger Hautop Drewsen Date: Wed, 21 Mar 2018 14:07:20 +0100 Subject: [PATCH] Support one-digit charges in battery widget --- battery-widget/battery.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/battery-widget/battery.lua b/battery-widget/battery.lua index badbc8f..01a3ddd 100644 --- a/battery-widget/battery.lua +++ b/battery-widget/battery.lua @@ -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"