aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-08-01 23:11:41 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-08-01 23:11:41 +0200
commit418151f57ebe56b84e35169e73912fe244871db5 (patch)
treeb25f130d73deeb91d8dcb9bb8b728b3af6aaba05
parent1630b786d4028a8075695c026391ee80cc9b9aca (diff)
downloadvicious-legacy-418151f57ebe56b84e35169e73912fe244871db5.tar.xz
Make all widgets return their worker functions when called.
-rw-r--r--bat.lua3
-rw-r--r--batat.lua3
-rw-r--r--cpu.lua3
-rw-r--r--date.lua3
-rw-r--r--dio.lua3
-rw-r--r--entropy.lua3
-rw-r--r--fs.lua3
-rw-r--r--load.lua3
-rw-r--r--mbox.lua3
-rw-r--r--mboxc.lua3
-rw-r--r--mdir.lua3
-rw-r--r--mem.lua3
-rw-r--r--mpd.lua5
-rw-r--r--net.lua3
-rw-r--r--org.lua3
-rw-r--r--pacman.lua3
-rw-r--r--thermal.lua3
-rw-r--r--uptime.lua3
-rw-r--r--volume.lua3
-rw-r--r--weather.lua3
-rw-r--r--wifi.lua3
21 files changed, 64 insertions, 1 deletions
diff --git a/bat.lua b/bat.lua
index 10ed49d..245eb22 100644
--- a/bat.lua
+++ b/bat.lua
@@ -6,6 +6,7 @@
-- {{{ Grab environment
local tonumber = tonumber
local io = { open = io.open }
+local setmetatable = setmetatable
local math = { floor = math.floor }
local string = {
find = string.find,
@@ -77,3 +78,5 @@ function worker(format, batid)
end
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/batat.lua b/batat.lua
index 0229203..7ab004c 100644
--- a/batat.lua
+++ b/batat.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local io = { popen = io.popen }
+local setmetatable = setmetatable
local table = { insert = table.insert }
-- }}}
@@ -46,3 +47,5 @@ function worker(format)
return battery_info
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/cpu.lua b/cpu.lua
index 5112253..7f0a006 100644
--- a/cpu.lua
+++ b/cpu.lua
@@ -8,6 +8,7 @@ local type = type
local pairs = pairs
local ipairs = ipairs
local io = { open = io.open }
+local setmetatable = setmetatable
local math = { floor = math.floor }
local table = { insert = table.insert }
local helpers = require("vicious.helpers")
@@ -93,3 +94,5 @@ function worker(format, padding)
return cpu_usage
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/date.lua b/date.lua
index e6ea108..dfdeaba 100644
--- a/date.lua
+++ b/date.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local os = { date = os.date }
+local setmetatable = setmetatable
-- }}}
@@ -22,3 +23,5 @@ function worker(format)
end
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/dio.lua b/dio.lua
index e3d5343..4e394a4 100644
--- a/dio.lua
+++ b/dio.lua
@@ -7,6 +7,7 @@
local type = type
local ipairs = ipairs
local io = { open = io.open }
+local setmetatable = setmetatable
local math = { floor = math.floor }
local table = { insert = table.insert }
-- }}}
@@ -71,3 +72,5 @@ function worker(format, disk)
return disk_usage
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/entropy.lua b/entropy.lua
index 43bdb80..a41fb38 100644
--- a/entropy.lua
+++ b/entropy.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local io = { open = io.open }
+local setmetatable = setmetatable
local math = { floor = math.floor }
local string = { format = string.format }
-- }}}
@@ -35,3 +36,5 @@ function worker(format, poolsize)
return {ent_avail, ent_avail_percent}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/fs.lua b/fs.lua
index 3afe801..313f91e 100644
--- a/fs.lua
+++ b/fs.lua
@@ -6,6 +6,7 @@
-- {{{ Grab environment
local type = type
local io = { popen = io.popen }
+local setmetatable = setmetatable
local helpers = require("vicious.helpers")
-- }}}
@@ -54,3 +55,5 @@ function worker(format, padding)
return args
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/load.lua b/load.lua
index 50e1a22..cce1388 100644
--- a/load.lua
+++ b/load.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local io = { open = io.open }
+local setmetatable = setmetatable
-- }}}
@@ -26,3 +27,5 @@ function worker(format)
return {avg1, avg5, avg15}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/mbox.lua b/mbox.lua
index fae3355..f0a5817 100644
--- a/mbox.lua
+++ b/mbox.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local io = { open = io.open }
+local setmetatable = setmetatable
local string = { gfind = string.gfind }
local helpers = require("vicious.helpers")
-- }}}
@@ -43,3 +44,5 @@ function worker(format, mbox)
end
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/mboxc.lua b/mboxc.lua
index b549b69..73dbe4e 100644
--- a/mboxc.lua
+++ b/mboxc.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local io = { open = io.open }
+local setmetatable = setmetatable
local string = { find = string.find }
-- }}}
@@ -55,3 +56,5 @@ function worker(format, mbox)
return {total, old, new}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/mdir.lua b/mdir.lua
index 6a5146b..63ce1c2 100644
--- a/mdir.lua
+++ b/mdir.lua
@@ -6,6 +6,7 @@
-- {{{ Grab environment
local io = { popen = io.popen }
+local setmetatable = setmetatable
-- }}}
@@ -42,3 +43,5 @@ function worker(format, mdir)
return {newcount, curcount}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/mem.lua b/mem.lua
index 818e501..7183aa7 100644
--- a/mem.lua
+++ b/mem.lua
@@ -7,6 +7,7 @@
local type = type
local tonumber = tonumber
local io = { open = io.open }
+local setmetatable = setmetatable
local math = { floor = math.floor }
local helpers = require("vicious.helpers")
-- }}}
@@ -74,3 +75,5 @@ function worker(format, padding)
swap_usepercent, swap_inuse, swap_total, swap_free}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/mpd.lua b/mpd.lua
index 2dc95f8..f8c0400 100644
--- a/mpd.lua
+++ b/mpd.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local io = { popen = io.popen }
+local setmetatable = setmetatable
local helpers = require("vicious.helpers")
-- }}}
@@ -14,7 +15,7 @@ module("vicious.mpd")
-- {{{ MPD widget type
-function worker()
+function worker(format)
-- This one is as simple as they come. Using sockets or expanding
-- it is a lost cause since there are already a few MPD Lua libs
-- written for awesome. Use them.
@@ -40,3 +41,5 @@ function worker()
return {nowplaying}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/net.lua b/net.lua
index 9428c5d..c9f0fb2 100644
--- a/net.lua
+++ b/net.lua
@@ -7,6 +7,7 @@
local tonumber = tonumber
local os = { time = os.time }
local io = { open = io.open }
+local setmetatable = setmetatable
local math = { floor = math.floor }
local helpers = require("vicious.helpers")
-- }}}
@@ -113,3 +114,5 @@ function worker(format, padding)
return args
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/org.lua b/org.lua
index 5632179..a4c1754 100644
--- a/org.lua
+++ b/org.lua
@@ -6,6 +6,7 @@
-- {{{ Grab environment
local io = { open = io.open }
+local setmetatable = setmetatable
local string = { find = string.find }
local os = {
time = os.time,
@@ -68,3 +69,5 @@ function worker(format, files)
return {count.past, count.today, count.soon, count.future}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/pacman.lua b/pacman.lua
index 0d8f80a..bdf9ef7 100644
--- a/pacman.lua
+++ b/pacman.lua
@@ -6,6 +6,7 @@
-- {{{ Grab environment
local tonumber = tonumber
local io = { popen = io.popen }
+local setmetatable = setmetatable
-- }}}
@@ -36,3 +37,5 @@ function worker(format)
return {updates}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/thermal.lua b/thermal.lua
index 02b1f54..8d4057a 100644
--- a/thermal.lua
+++ b/thermal.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local io = { open = io.open }
+local setmetatable = setmetatable
-- }}}
@@ -25,3 +26,5 @@ function worker(format, thermal_zone)
return {temperature}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/uptime.lua b/uptime.lua
index eae1d35..82cb20a 100644
--- a/uptime.lua
+++ b/uptime.lua
@@ -6,6 +6,7 @@
-- {{{ Grab environment
local tonumber = tonumber
local io = { open = io.open }
+local setmetatable = setmetatable
local math = { floor = math.floor }
local helpers = require("vicious.helpers")
-- }}}
@@ -49,3 +50,5 @@ function worker(format, padding)
return {total_uptime, uptime_days, uptime_hours, uptime_minutes, uptime_seconds}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/volume.lua b/volume.lua
index fd02b76..14a7b0f 100644
--- a/volume.lua
+++ b/volume.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local io = { popen = io.popen }
+local setmetatable = setmetatable
local string = { match = string.match }
-- }}}
@@ -31,3 +32,5 @@ function worker(format, channel)
return {volume_level}
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/weather.lua b/weather.lua
index e14c0ed..c8dd5ac 100644
--- a/weather.lua
+++ b/weather.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local io = { popen = io.popen }
+local setmetatable = setmetatable
local math = { floor = math.floor }
local string = { match = string.match }
-- }}}
@@ -73,3 +74,5 @@ function worker(format, station)
return weather
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })
diff --git a/wifi.lua b/wifi.lua
index 35289dd..0e284c8 100644
--- a/wifi.lua
+++ b/wifi.lua
@@ -5,6 +5,7 @@
-- {{{ Grab environment
local io = { popen = io.popen }
+local setmetatable = setmetatable
local string = {
find = string.find,
match = string.match
@@ -60,3 +61,5 @@ function worker(format, iface)
return winfo
end
-- }}}
+
+setmetatable(_M, { __call = function(_, ...) return worker(...) end })