Ported vicious.contrib to lua 5.2
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com> Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
This commit is contained in:
parent
41cc2c0e27
commit
8e35a983bf
|
@ -13,7 +13,8 @@ local string = { match = string.match }
|
|||
|
||||
|
||||
-- Batacpi: provides state, charge, and remaining time for all batteries using acpitool
|
||||
module("vicious.contrib.batacpi")
|
||||
-- vicious.contrib.batacpi
|
||||
local batacpi = {}
|
||||
|
||||
|
||||
-- {{{ Battery widget type
|
||||
|
@ -48,4 +49,4 @@ local function worker(format)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(batacpi, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
|
@ -20,7 +20,8 @@ local string = {
|
|||
|
||||
|
||||
-- Batpmu: provides state, charge and remaining time for a requested battery using PMU
|
||||
module("vicious.contrib.batpmu")
|
||||
-- vicious.contrib.batpmu
|
||||
local batpmu = {}
|
||||
|
||||
|
||||
-- {{{ Battery widget type
|
||||
|
@ -75,4 +76,4 @@ local function worker(format, batid)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(batpmu, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
|
@ -20,7 +20,8 @@ local string = {
|
|||
|
||||
|
||||
-- Batproc: provides state, charge, and remaining time for a requested battery using procfs
|
||||
module("vicious.contrib.batproc")
|
||||
-- vicious.contrib.batproc
|
||||
local batproc = {}
|
||||
|
||||
|
||||
-- {{{ Battery widget type
|
||||
|
@ -82,4 +83,4 @@ local function worker(format, batid)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(batproc, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
|
@ -13,7 +13,8 @@ local helpers = require("vicious.helpers")
|
|||
|
||||
|
||||
-- Disk I/O: provides I/O statistics for requested storage devices
|
||||
module("vicious.contrib.dio")
|
||||
-- vicious.contrib.dio
|
||||
local dio = {}
|
||||
|
||||
|
||||
-- Initialize function tables
|
||||
|
@ -69,4 +70,4 @@ local function worker(format, disk)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(dio, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
|
@ -10,8 +10,9 @@ local setmetatable = setmetatable
|
|||
local wrequire = require("vicious.helpers").wrequire
|
||||
|
||||
-- Vicious: widgets for the awesome window manager
|
||||
module("vicious.contrib")
|
||||
-- vicious.contrib
|
||||
local contrib = {}
|
||||
-- }}}
|
||||
|
||||
-- Load modules at runtime as needed
|
||||
setmetatable(_M, { __index = wrequire })
|
||||
return setmetatable(contrib, { __index = wrequire })
|
||||
|
|
|
@ -14,7 +14,8 @@ local helpers = require("vicious.helpers")
|
|||
|
||||
|
||||
-- Mpc: provides the currently playing song in MPD
|
||||
module("vicious.contrib.mpc")
|
||||
-- vicious.contrib.mpc
|
||||
local mpc = {}
|
||||
|
||||
|
||||
-- {{{ MPC widget type
|
||||
|
@ -44,4 +45,4 @@ local function worker(format, warg)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(mpc, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
|
@ -17,7 +17,8 @@ local helpers = require("vicious.helpers")
|
|||
|
||||
|
||||
-- Net: provides usage statistics for all network interfaces
|
||||
module("vicious.contrib.net")
|
||||
-- vicious.contrib.net
|
||||
local net = {}
|
||||
|
||||
|
||||
-- Initialise function tables
|
||||
|
@ -135,4 +136,4 @@ local function worker(format, tignorelist)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(net, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
|
@ -11,7 +11,8 @@ local table = { insert = table.insert }
|
|||
|
||||
|
||||
-- Netcfg: provides active netcfg network profiles
|
||||
module("vicious.contrib.netcfg")
|
||||
-- vicious.contrib.netcfg
|
||||
local netcfg = {}
|
||||
|
||||
|
||||
-- {{{ Netcfg widget type
|
||||
|
@ -31,4 +32,4 @@ local function worker(format)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(netcfg, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
|
@ -12,7 +12,8 @@ local string = { match = string.match }
|
|||
|
||||
|
||||
-- Ossvol: provides volume levels of requested OSS mixers
|
||||
module("vicious.contrib.ossvol")
|
||||
-- vicious.contrib.ossvol
|
||||
local ossvol = {}
|
||||
|
||||
|
||||
-- {{{ Volume widget type
|
||||
|
@ -50,4 +51,4 @@ local function worker(format, warg)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(ossvol, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
|
@ -19,7 +19,8 @@ end)
|
|||
|
||||
|
||||
-- POP: provides the count of new messages in a POP3 mailbox
|
||||
module("vicious.contrib.pop")
|
||||
-- vicious.contrib.pop
|
||||
local pop = {}
|
||||
|
||||
|
||||
-- {{{ POP3 count widget type
|
||||
|
@ -51,4 +52,4 @@ local function worker(format, warg)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(pop, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
|
@ -24,7 +24,8 @@ local math = {
|
|||
|
||||
|
||||
-- Pulse: provides volume levels of requested pulseaudio sinks and methods to change them
|
||||
module("vicious.contrib.pulse")
|
||||
-- vicious.contrib.pulse
|
||||
local pulse = {}
|
||||
|
||||
-- {{{ Helper function
|
||||
local function pacmd(args)
|
||||
|
@ -79,7 +80,7 @@ end
|
|||
-- }}}
|
||||
|
||||
-- {{{ Volume control helper
|
||||
function add(percent, sink)
|
||||
function pulse.add(percent, sink)
|
||||
sink = get_sink_name(sink)
|
||||
if sink == nil then return end
|
||||
|
||||
|
@ -96,7 +97,7 @@ function add(percent, sink)
|
|||
return os.execute(cmd)
|
||||
end
|
||||
|
||||
function toggle(sink)
|
||||
function pulse.toggle(sink)
|
||||
sink = get_sink_name(sink)
|
||||
if sink == nil then return end
|
||||
|
||||
|
@ -111,4 +112,4 @@ function toggle(sink)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(pulse, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
|
@ -14,7 +14,8 @@ local setmetatable = setmetatable
|
|||
|
||||
|
||||
-- RSS: provides latest world news
|
||||
module("vicious.contrib.rss")
|
||||
-- vicious.contrib.rss
|
||||
local rss = {}
|
||||
|
||||
|
||||
-- {{{ RSS widget type
|
||||
|
@ -64,4 +65,4 @@ local function worker(format, input)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(rss, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
|
@ -16,7 +16,8 @@ local string = {
|
|||
|
||||
|
||||
-- Sensors: provides access to lm_sensors data
|
||||
module("vicious.contrib.sensors")
|
||||
-- vicious.contrib.sensors
|
||||
local sensors = {}
|
||||
|
||||
|
||||
-- {{{ Split helper function
|
||||
|
@ -65,4 +66,4 @@ local function worker(format, warg)
|
|||
end
|
||||
-- }}}
|
||||
|
||||
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
|
||||
return setmetatable(sensors, { __call = function(_, ...) return worker(...) end })
|
||||
|
|
Loading…
Reference in New Issue