X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/0e37d220b793edbefb7064315cb7274fe5282862..1793f94b00c04639e97bad43b50bbc111a8f393d:/widgets/bat.lua?ds=sidebyside diff --git a/widgets/bat.lua b/widgets/bat.lua index d84a5d8..991885a 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -135,6 +135,10 @@ local function worker(args) bat_now.perc = math.floor(math.min(100, (sum_energy_now / sum_energy_full) * 100)) bat_now.time = string.format("%02d:%02d", hours, minutes) bat_now.watt = tonumber(string.format("%.2f", sum_rate_energy / 1e6)) + elseif bat_now.status ~= "Full" and sum_rate_power == 0 and bat_now.ac_status == 1 then + bat_now.perc = math.floor(math.min(100, (sum_energy_now / sum_energy_full) * 100)) + bat_now.time = "00:00" + bat_now.watt = 0 elseif bat_now.status == "Full" then bat_now.perc = 100 bat_now.time = "00:00"