X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/f82f0ed20542258833e866c8f33bc54c57c3b863..d9877c4bedca550478507f268f43e137e4454c24:/widgets/fs.lua diff --git a/widgets/fs.lua b/widgets/fs.lua index 391c260..eda3ffc 100644 --- a/widgets/fs.lua +++ b/widgets/fs.lua @@ -37,7 +37,7 @@ function fs.show(seconds, scr) if fs.followtag then fs.notification_preset.screen = focused() elseif scr then - fs.notification_preset.screen = scr + fs.notification_preset.screen = scr or 1 end local cmd = (fs.options and string.format("dfs %s", fs.options)) or "dfs" @@ -74,10 +74,9 @@ local function worker(args) helpers.set_map(partition, false) - function update() fs_info, fs_now = {}, {} - helpers.async(string.format("%s -c 'LC_ALL=C df -k --output=target,size,used,avail,pcent'", shell), function(f) + helpers.async({ shell, "-c", "LC_ALL=C df -k --output=target,size,used,avail,pcent" }, function(f) for line in string.gmatch(f, "\n[^\n]+") do local m,s,u,a,p = string.match(line, "(/.-%s).-(%d+).-(%d+).-(%d+).-([%d]+)%%") m = m:gsub(" ", "") -- clean target from any whitespace @@ -107,11 +106,9 @@ local function worker(args) if notify == "on" and tonumber(fs_now.used) >= 99 and not helpers.get_map(partition) then naughty.notify({ - title = "Warning", - text = partition .. " is empty!", - timeout = 8, - fg = "#000000", - bg = "#FFFFFF" + preset = naughty.config.presets.critical, + title = "Warning", + text = partition .. " is empty", }) helpers.set_map(partition, true) else