aboutsummaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2012-06-18 01:30:26 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2012-06-18 01:31:42 +0200
commite929bea270875c8fa831747bd3ee3090561f2113 (patch)
tree3fccf7766480d6c0ce1d9405634170aa032e016a /widgets
parent363c03e79c334cc0f3d75c1a3b60edbca0214465 (diff)
downloadvicious-legacy-e929bea270875c8fa831747bd3ee3090561f2113.tar.xz
widgets: cleanup behind the last commit 363c03e
Diffstat (limited to 'widgets')
-rw-r--r--widgets/cpu.lua7
-rw-r--r--widgets/mem.lua2
-rw-r--r--widgets/raid.lua6
3 files changed, 7 insertions, 8 deletions
diff --git a/widgets/cpu.lua b/widgets/cpu.lua
index 125db96..fe6754a 100644
--- a/widgets/cpu.lua
+++ b/widgets/cpu.lua
@@ -15,7 +15,6 @@ local string = {
sub = string.sub,
gmatch = string.gmatch
}
-local naught = require("naughty")
-- }}}
@@ -34,8 +33,8 @@ local function worker(format)
local cpu_lines = {}
-- Get CPU stats
- local fd = io.open("/proc/stat")
- for line in fd:lines() do
+ local f = io.open("/proc/stat")
+ for line in f:lines() do
if string.sub(line, 1, 3) ~= "cpu" then break end
cpu_lines[#cpu_lines+1] = {}
@@ -44,7 +43,7 @@ local function worker(format)
table.insert(cpu_lines[#cpu_lines], i)
end
end
- fd:close()
+ f:close()
-- Ensure tables are initialized correctly
for i = #cpu_total + 1, #cpu_lines do
diff --git a/widgets/mem.lua b/widgets/mem.lua
index d122654..67ef42a 100644
--- a/widgets/mem.lua
+++ b/widgets/mem.lua
@@ -44,7 +44,7 @@ local function worker(format)
_mem.swp.usep = math.floor(_mem.swp.inuse / _mem.swp.t * 100)
return {_mem.usep, _mem.inuse, _mem.total, _mem.free,
- _mem.swp.usep, _mem.swp.inuse, _mem.swp.t, _mem.swp.f,
+ _mem.swp.usep, _mem.swp.inuse, _mem.swp.t, _mem.swp.f,
_mem.bcuse }
end
-- }}}
diff --git a/widgets/raid.lua b/widgets/raid.lua
index 58a7359..eafb118 100644
--- a/widgets/raid.lua
+++ b/widgets/raid.lua
@@ -33,8 +33,8 @@ local function worker(format, warg)
}
-- Linux manual page: md(4)
- local fd = io.open("/proc/mdstat")
- for line in fd:lines() do
+ local f = io.open("/proc/mdstat")
+ for line in f:lines() do
if mddev[warg]["found"] then
local updev = string.match(line, "%[[_U]+%]")
@@ -51,7 +51,7 @@ local function worker(format, warg)
end
end
end
- fd:close()
+ f:close()
return {mddev[warg]["assigned"], mddev[warg]["active"]}
end