From a6ca6ab03005cb4fe944f4e4e56bf432ef1f3327 Mon Sep 17 00:00:00 2001 From: Luke Bonham Date: Fri, 24 Feb 2017 13:08:13 +0100 Subject: [PATCH] fix #321 --- widget/bat.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/widget/bat.lua b/widget/bat.lua index 4182e07..3067b39 100644 --- a/widget/bat.lua +++ b/widget/bat.lua @@ -17,7 +17,6 @@ local math = { abs = math.abs, min = math.min } local string = { format = string.format } local ipairs = ipairs -local type = type local tonumber = tonumber -- Battery infos @@ -158,13 +157,13 @@ local function factory(args) settings() -- notifications for low and critical states - if notify == "on" and type(bat_now.perc) == "number" and bat_now.status == "Discharging" then - if bat_now.perc <= 5 then + if notify == "on" and bat_now.status == "Discharging" then + if tonumber(bat_now.perc) <= 5 then bat.id = naughty.notify({ preset = bat_notification_critical_preset, replaces_id = bat.id }).id - elseif bat_now.perc <= 15 then + elseif tonumber(bat_now.perc) <= 15 then bat.id = naughty.notify({ preset = bat_notification_low_preset, replaces_id = bat.id -- 2.39.2