X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/83ad59e0e7df53d257f1d70d0fe623a3e3b5596b..a6ca6ab03005cb4fe944f4e4e56bf432ef1f3327:/widget/bat.lua?ds=sidebyside 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