aboutsummaryrefslogtreecommitdiff
path: root/widgets/pkg.lua
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/pkg.lua')
-rw-r--r--widgets/pkg.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/widgets/pkg.lua b/widgets/pkg.lua
index 62d0ccb..9ec03c0 100644
--- a/widgets/pkg.lua
+++ b/widgets/pkg.lua
@@ -11,7 +11,8 @@ local setmetatable = setmetatable
-- Pkg: provides number of pending updates on UNIX systems
-module("vicious.widgets.pkg")
+-- vicious.widgets.pkg
+local pkg = {}
-- {{{ Packages widget type
@@ -31,16 +32,16 @@ local function worker(format, warg)
}
-- Check if updates are available
- local pkg = manager[warg]
- local f = io.popen(pkg.cmd)
+ local _pkg = manager[warg]
+ local f = io.popen(_pkg.cmd)
for line in f:lines() do
updates = updates + 1
end
f:close()
- return {pkg.sub and math.max(updates-pkg.sub, 0) or updates}
+ return {_pkg.sub and math.max(updates-_pkg.sub, 0) or updates}
end
-- }}}
-setmetatable(_M, { __call = function(_, ...) return worker(...) end })
+return setmetatable(pkg, { __call = function(_, ...) return worker(...) end })