From 2cfdd5aac7acd54591a7305c364eba9219fad04f Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Thu, 15 Oct 2009 21:36:24 +0200 Subject: bat: quick fix for broken BAT/ACPI implementations --- bat.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bat.lua') diff --git a/bat.lua b/bat.lua index 09f1366..6a759e9 100644 --- a/bat.lua +++ b/bat.lua @@ -63,6 +63,9 @@ local function worker(format, batid) -- Calculate percentage local percent = math.floor(remaining / capacity * 100) local percent = string.format("%02d", percent) + -- Work around broken batteries and/or ACPI implementations + if state == "↯" and tonumber(percent) > 100 then percent = 100 end + -- Calculate remaining (charging or discharging) time if state == "+" then -- cgit v1.2.3