X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/a34e72b42bfa681afba744a190d8bb3e26252310..013654cd1af4bb69f31c1c641cdb24bd8b7c58df:/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