This commit is contained in:
Jörg Thalheim 2012-06-25 20:45:14 +02:00
commit 01893953a6
10 changed files with 25 additions and 29 deletions

3
README
View File

@ -291,7 +291,8 @@ in the contrib directory of Vicious. The contrib directory contains
extra widgets you can use. Some are for less common hardware, and
other were contributed by Vicious users. The contrib directory also
holds widget types that were obsoleted or rewritten. Contrib widgets
will not be imported by init unless you explicitly enable it.
will not be imported by init unless you explicitly enable it, or load
them in your rc.lua.
Richard Kolkovich, a FreeBSD user, published his vicious-fbsd
branch. If you are also a BSD user you can find his work here:

View File

@ -4,7 +4,17 @@ Contrib widgets are extra widgets you can use. Some are for less
common hardware, and other were contributed by Vicious users. The
contrib directory also holds widget types that were obsoleted or
rewritten. Contrib widgets will not be imported by init unless you
explicitly enable it.
explicitly enable it, or load them in your rc.lua.
Usage
-----
To use contrib widgets uncomment the line that loads them in
init.lua. Or you can load them in your rc.lua after you require
Vicious:
local vicious = require("vicious")
vicious.contrib = require("vicious.contrib")
Widget types

View File

@ -32,4 +32,4 @@ end
-- }}}
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
return setmetatable(_M, { __call = function(_, ...) return worker(...) end })

View File

@ -11,7 +11,7 @@ local wrequire = require("vicious.helpers").wrequire
-- Vicious: widgets for the awesome window manager
-- vicious.contrib
local contrib = {}
local contrib = { _NAME = "vicious.contrib" }
-- }}}
-- Load modules at runtime as needed

View File

@ -62,6 +62,4 @@ local function worker(format, warg)
end
-- }}}
setmetatable(_M, { __call = function(_, ...) return worker(...) end })
return setmetatable(_M, { __call = function(_, ...) return worker(...) end })

View File

@ -33,11 +33,10 @@ local scroller = {}
-- {{{ Helper functions
-- {{{ Loader of vicious modules
function helpers.wrequire(table, key)
local module = rawget(table, key)
function helpers.wrequire(table, key)
local module = rawget(table, key)
return module or require(table._NAME .. "." .. key)
end
-- }}}
-- {{{ Expose path as a Lua table
function helpers.pathtotable(dir)

View File

@ -16,12 +16,12 @@ local table = {
insert = table.insert,
remove = table.remove
}
local helpers = require("vicious.helpers")
-- Vicious: widgets for the awesome window manager
local vicious = {}
vicious.widgets = require("vicious.widgets")
--vicious.contrib = require("vicious.contrib")
-- Initialize tables
local timers = {}

View File

@ -1,18 +1,5 @@
---------------------------------------------------
-- Vicious widgets for the awesome window manager
---------------------------------------------------
-- Licensed under the GNU General Public License v2
-- * (c) 2010, Adrian C. <anrxc@sysphere.org>
---------------------------------------------------
-- {{{ Setup environment
local setmetatable = setmetatable
local wrequire = require("vicious.helpers").wrequire
widgets = { _NAME = "vicious.widgets" }
-- Vicious: widgets for the awesome window manager
-- vicious.widgets
local widgets = { _NAME = "vicious.widgets" }
-- }}}
-- Load modules at runtime as needed
return setmetatable(widgets, { __index = wrequire })
return setmetatable(widgets, {__index = wrequire})

View File

@ -7,8 +7,8 @@
local pairs = pairs
local tonumber = tonumber
local io = { popen = io.popen }
local os = { getenv = os.getenv }
local math = { ceil = math.ceil }
local los = { getenv = os.getenv }
local setmetatable = setmetatable
local helpers = require("vicious.helpers")
local string = {
@ -63,7 +63,7 @@ local function worker(format)
end
-- Get user from the environment
system["username"] = os.getenv("USER")
system["username"] = los.getenv("USER")
return {system["ostype"], system["osrelease"], system["username"],
system["hostname"], system["entropy"], system["entropy_p"]}

View File

@ -33,4 +33,5 @@ local function worker(format)
end
-- }}}
local setmetatable(uptime, { __call = function(_, ...) return worker(...) end })
setmetatable(uptime, { __call = function(_, ...) return worker(...) end })
return uptime