bat: quick fix for broken BAT/ACPI implementations
This commit is contained in:
parent
64464efbd4
commit
2cfdd5aac7
3
bat.lua
3
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
|
||||
|
|
Loading…
Reference in New Issue