From: Andrej KouĊ™il Date: Sun, 27 Mar 2016 13:28:52 +0000 (+0200) Subject: Added rule for bat_now.status = Full when rate suppose be 0 X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/2b4e911dfd6ca7fe0fde48ddd095dc70d2c32fe3?hp=37c4198cdf300b4dab002e5cbc9ea2590f17f168 Added rule for bat_now.status = Full when rate suppose be 0 --- diff --git a/widgets/bat.lua b/widgets/bat.lua index 8cc1ea9..9bd526a 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -91,6 +91,14 @@ local function worker(args) bat_now.status = first_line(bstr .. "/status") or "N/A" bat_now.ac_status = first_line(astr .. "/online") or "N/A" + -- if rate = 0 or rate not defined skip the round + if not (rate_power and rate_power > 0) and + not (rate_current and rate_current > 0) and + not bat_now.status == "Full" + then + return + end + local rate_time = 0 if bat_now.status == "Charging" then