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 extra widgets you can use. Some are for less common hardware, and
other were contributed by Vicious users. The contrib directory also other were contributed by Vicious users. The contrib directory also
holds widget types that were obsoleted or rewritten. Contrib widgets 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 Richard Kolkovich, a FreeBSD user, published his vicious-fbsd
branch. If you are also a BSD user you can find his work here: 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 common hardware, and other were contributed by Vicious users. The
contrib directory also holds widget types that were obsoleted or contrib directory also holds widget types that were obsoleted or
rewritten. Contrib widgets will not be imported by init unless you 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 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: widgets for the awesome window manager
-- vicious.contrib -- vicious.contrib
local contrib = {} local contrib = { _NAME = "vicious.contrib" }
-- }}} -- }}}
-- Load modules at runtime as needed -- Load modules at runtime as needed

View File

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

View File

@ -37,7 +37,6 @@ function helpers.wrequire(table, key)
local module = rawget(table, key) local module = rawget(table, key)
return module or require(table._NAME .. "." .. key) return module or require(table._NAME .. "." .. key)
end end
-- }}}
-- {{{ Expose path as a Lua table -- {{{ Expose path as a Lua table
function helpers.pathtotable(dir) function helpers.pathtotable(dir)

View File

@ -16,12 +16,12 @@ local table = {
insert = table.insert, insert = table.insert,
remove = table.remove remove = table.remove
} }
local helpers = require("vicious.helpers") local helpers = require("vicious.helpers")
-- Vicious: widgets for the awesome window manager -- Vicious: widgets for the awesome window manager
local vicious = {} local vicious = {}
vicious.widgets = require("vicious.widgets") vicious.widgets = require("vicious.widgets")
--vicious.contrib = require("vicious.contrib")
-- Initialize tables -- Initialize tables
local timers = {} 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 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 pairs = pairs
local tonumber = tonumber local tonumber = tonumber
local io = { popen = io.popen } local io = { popen = io.popen }
local os = { getenv = os.getenv }
local math = { ceil = math.ceil } local math = { ceil = math.ceil }
local los = { getenv = os.getenv }
local setmetatable = setmetatable local setmetatable = setmetatable
local helpers = require("vicious.helpers") local helpers = require("vicious.helpers")
local string = { local string = {
@ -63,7 +63,7 @@ local function worker(format)
end end
-- Get user from the environment -- Get user from the environment
system["username"] = os.getenv("USER") system["username"] = los.getenv("USER")
return {system["ostype"], system["osrelease"], system["username"], return {system["ostype"], system["osrelease"], system["username"],
system["hostname"], system["entropy"], system["entropy_p"]} system["hostname"], system["entropy"], system["entropy_p"]}

View File

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