From: luke bonham Date: Wed, 2 Oct 2013 14:24:55 +0000 (+0200) Subject: issue #7 fix X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/e72deb9de709a9adaa3a239a4e18ed641538de6e?hp=62d5cba13042914027e33814c8fc03906b89aa6b issue #7 fix --- diff --git a/widgets/fs.lua b/widgets/fs.lua index b434056..7406e05 100644 --- a/widgets/fs.lua +++ b/widgets/fs.lua @@ -65,6 +65,7 @@ local function worker(args) function update() fs_info = {} + fs_now = {} local f = io.popen("LC_ALL=C df -kP") @@ -85,15 +86,15 @@ local function worker(args) -- chosen partition easy stuff -- you can however check whatever partition else - used = tonumber(fs_info[partition .. " used_p"]) - available = tonumber(fs_info[partition .. " avail_p"]) - size_mb = tonumber(fs_info[partition .. " size_mb"]) - size_gb = tonumber(fs_info[partition .. " size_gb"]) + fs_now.used = tonumber(fs_info[partition .. " used_p"]) or 0 + fs_now.available = tonumber(fs_info[partition .. " avail_p"]) or 0 + fs_now.size_mb = tonumber(fs_info[partition .. " size_mb"]) or 0 + fs_now.size_gb = tonumber(fs_info[partition .. " size_gb"]) or 0 widget = fs.widget settings() - if used >= 99 and not helpers.get_map("fs") + if fs_now.used >= 99 and not helpers.get_map("fs") then naughty.notify({ title = "warning",