fix #321
This commit is contained in:
parent
dfca7ef85a
commit
a6ca6ab030
1 changed files with 3 additions and 4 deletions
|
@ -17,7 +17,6 @@ local math = { abs = math.abs,
|
||||||
min = math.min }
|
min = math.min }
|
||||||
local string = { format = string.format }
|
local string = { format = string.format }
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local type = type
|
|
||||||
local tonumber = tonumber
|
local tonumber = tonumber
|
||||||
|
|
||||||
-- Battery infos
|
-- Battery infos
|
||||||
|
@ -158,13 +157,13 @@ local function factory(args)
|
||||||
settings()
|
settings()
|
||||||
|
|
||||||
-- notifications for low and critical states
|
-- notifications for low and critical states
|
||||||
if notify == "on" and type(bat_now.perc) == "number" and bat_now.status == "Discharging" then
|
if notify == "on" and bat_now.status == "Discharging" then
|
||||||
if bat_now.perc <= 5 then
|
if tonumber(bat_now.perc) <= 5 then
|
||||||
bat.id = naughty.notify({
|
bat.id = naughty.notify({
|
||||||
preset = bat_notification_critical_preset,
|
preset = bat_notification_critical_preset,
|
||||||
replaces_id = bat.id
|
replaces_id = bat.id
|
||||||
}).id
|
}).id
|
||||||
elseif bat_now.perc <= 15 then
|
elseif tonumber(bat_now.perc) <= 15 then
|
||||||
bat.id = naughty.notify({
|
bat.id = naughty.notify({
|
||||||
preset = bat_notification_low_preset,
|
preset = bat_notification_low_preset,
|
||||||
replaces_id = bat.id
|
replaces_id = bat.id
|
||||||
|
|
Loading…
Add table
Reference in a new issue