X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/1342ae481bc727c45a7e773ec8f815177a9299f5..1a40fe80f801a27e047ce29f57215eca8f84bf6f:/widget/fs.lua diff --git a/widget/fs.lua b/widget/fs.lua index 358d4dd..d1b7a97 100644 --- a/widget/fs.lua +++ b/widget/fs.lua @@ -52,6 +52,7 @@ local function factory(args) local args = args or {} local timeout = args.timeout or 600 local partition = args.partition + local threshold = args.threshold or 99 local showpopup = args.showpopup or "on" local settings = args.settings or function() end @@ -106,12 +107,12 @@ local function factory(args) widget = fs.widget settings() - if partition and fs_now[partition] and fs_now[partition].used >= 99 then + if partition and fs_now[partition] and fs_now[partition].percentage >= threshold then if not helpers.get_map(partition) then naughty.notify { preset = naughty.config.presets.critical, title = "Warning", - text = partition .. " is full", + text = string.format("%s is above %d%% (%d%%)", partition, threshold, fs_now[partition].percentage) } helpers.set_map(partition, true) else