From 444ffd03c128f45ac1227b33ceb951ae12506a70 Mon Sep 17 00:00:00 2001 From: copycat-killer Date: Sat, 21 Jan 2017 01:30:39 +0100 Subject: [PATCH] fs/alsabar: small fixes --- widgets/alsabar.lua | 3 ++- widgets/fs.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/widgets/alsabar.lua b/widgets/alsabar.lua index 9fe5339..15ba311 100644 --- a/widgets/alsabar.lua +++ b/widgets/alsabar.lua @@ -19,6 +19,7 @@ local string = { format = string.format, match = string.match, rep = string.rep } local tonumber = tonumber +local type = type local setmetatable = setmetatable @@ -101,7 +102,7 @@ local function worker(args) settings() - if callback then callback() end + if type(callback) == "function" then callback() end end end) end diff --git a/widgets/fs.lua b/widgets/fs.lua index d5dd49a..f07ef98 100644 --- a/widgets/fs.lua +++ b/widgets/fs.lua @@ -98,7 +98,7 @@ local function worker(args) widget = fs.widget settings() - if notify == "on" and fs_now.used >= 99 and not helpers.get_map(partition) then + if notify == "on" and tonumber(fs_now.used) >= 99 and not helpers.get_map(partition) then naughty.notify({ title = "warning", text = partition .. " is empty!", -- 2.39.2