From 2b4e911dfd6ca7fe0fde48ddd095dc70d2c32fe3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andrej=20Kou=C5=99il?= Date: Sun, 27 Mar 2016 15:28:52 +0200 Subject: [PATCH 1/1] Added rule for bat_now.status = Full when rate suppose be 0 --- widgets/bat.lua | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.39.5