This commit is contained in:
Jörg Thalheim 2013-05-28 21:26:01 +02:00
commit c1dd257bc7
3 changed files with 26 additions and 11 deletions

View File

@ -2,6 +2,10 @@
Full changelog is available online: Full changelog is available online:
http://git.sysphere.org/vicious/log/?showmsg=1 http://git.sysphere.org/vicious/log/?showmsg=1
--------------------------------------------------- ---------------------------------------------------
fac688e wifi: add support for /usr/bin binary path
f7fdd90 README: usage examples are for awesome version 3.4
d63343e contrib: add buildbot monitoring widget
8f2f155 Next release, tag 2.1.0
da37c09 mdir: add support for maildir whitespaces da37c09 mdir: add support for maildir whitespaces
eba6eb0 README: prefer vicious in global space eba6eb0 README: prefer vicious in global space
c28bac5 uptime: metatable bugfix after lua52 port fixed by Jorg Thalheim c28bac5 uptime: metatable bugfix after lua52 port fixed by Jorg Thalheim

4
README
View File

@ -373,8 +373,8 @@ file with their GPG key. Trough the GPG Passphrase Agent they could
then decrypt the file transparently while their session is active. then decrypt the file transparently while their session is active.
Usage examples Usage examples (for awesome v3.4)
-------------- ---------------------------------
Start with a simple widget, like date. Then build your setup from Start with a simple widget, like date. Then build your setup from
there, one widget at a time. Also remember that besides creating and there, one widget at a time. Also remember that besides creating and
registering widgets you have to add them to a wibox (statusbar) in registering widgets you have to add them to a wibox (statusbar) in

View File

@ -9,11 +9,11 @@ local math = { ceil = math.ceil }
local setmetatable = setmetatable local setmetatable = setmetatable
local helpers = require("vicious.helpers") local helpers = require("vicious.helpers")
local io = { local io = {
open = io.open, open = io.open,
popen = io.popen popen = io.popen
} }
local string = { local string = {
find = string.find, find = string.find,
match = string.match match = string.match
} }
-- }}} -- }}}
@ -24,6 +24,12 @@ local string = {
local wifi = {} local wifi = {}
-- {{{ Variable definitions
local iwconfig = "iwconfig"
local iwcpaths = { "/sbin", "/usr/sbin", "/usr/local/sbin", "/usr/bin" }
-- }}}
-- {{{ Wireless widget type -- {{{ Wireless widget type
local function worker(format, warg) local function worker(format, warg)
if not warg then return end if not warg then return end
@ -39,14 +45,19 @@ local function worker(format, warg)
["{sign}"] = 0 ["{sign}"] = 0
} }
-- Get data from iwconfig where available -- Sbin paths aren't in user PATH, search for the binary
local iwconfig = "/sbin/iwconfig" if iwconfig == "iwconfig" then
local f = io.open(iwconfig, "rb") for _, p in ipairs(iwcpaths) do
if not f then local f = io.open(p .. "/iwconfig", "rb")
iwconfig = "/usr/sbin/iwconfig" if f then
else iwconfig = p .. "/iwconfig"
f:close() f:close()
break
end
end
end end
-- Get data from iwconfig where available
local f = io.popen(iwconfig .." ".. warg .. " 2>&1") local f = io.popen(iwconfig .." ".. warg .. " 2>&1")
local iw = f:read("*all") local iw = f:read("*all")
f:close() f:close()