X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/84005d16a9c58f385434d3f2e97161ab764b3122..e363fdfeafc331ee29780905361f137aa691b5df:/widgets/bat.lua diff --git a/widgets/bat.lua b/widgets/bat.lua index 6db5d95..62d1469 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -110,8 +110,7 @@ local function worker(args) bat_now.ac_status = first_line(string.format("/sys/class/power_supply/%s/online", ac)) or "N/A" -- update {perc,time,watt} iff rate > 0 and battery not full - if (sum_rate_current > 0 or sum_rate_power > 0) - and bat_now.status ~= "N/A" and bat_now.status ~= "Full" + if (sum_rate_current > 0 or sum_rate_power > 0) and not (bat_now.status == "Full") then local rate_time = 0 @@ -134,7 +133,7 @@ local function worker(args) settings() -- notifications for low and critical states - if bat_now.status == "Discharging" and notify == "on" and bat_now.perc then + if notify == "on" and bat_now.perc and bat_now.status == "Discharging" then local nperc = tonumber(bat_now.perc) or 100 if nperc <= 5 then bat.id = naughty.notify({