From c532c0b0803c98a26d56875f0955ed43132bfed2 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Mon, 18 Oct 2010 16:36:07 +0200 Subject: [PATCH 1/9] contrib: fixed email of pulse widget author --- contrib/pulse.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/pulse.lua b/contrib/pulse.lua index 5986265..56369bf 100644 --- a/contrib/pulse.lua +++ b/contrib/pulse.lua @@ -1,6 +1,6 @@ --------------------------------------------------- -- Licensed under the GNU General Public License v2 --- * (c) 2010, MrMagne +-- * (c) 2010, MrMagne --------------------------------------------------- -- Usage example -- From 32a7be1d6dd25eb47937789b8cb689b67d2fbb84 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Tue, 19 Oct 2010 21:23:06 +0200 Subject: [PATCH 2/9] wifi: provide link quality in percent --- README | 2 +- widgets/wifi.lua | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README b/README index c038eaf..54ca144 100644 --- a/README +++ b/README @@ -198,7 +198,7 @@ vicious.widgets.wifi - provides wireless information for a requested interface - takes the network interface as an argument, i.e. "wlan0" - returns a table with string keys: {ssid}, {mode}, {chan}, {rate}, - {link} and {sign} + {link}, {linp} and {sign} vicious.widgets.mbox - provides the subject of last e-mail in a mbox file diff --git a/widgets/wifi.lua b/widgets/wifi.lua index 5801bd5..9e8583a 100644 --- a/widgets/wifi.lua +++ b/widgets/wifi.lua @@ -5,6 +5,7 @@ -- {{{ Grab environment local tonumber = tonumber +local math = { ceil = math.ceil } local setmetatable = setmetatable local io = { open = io.open, @@ -28,6 +29,7 @@ local winfo = { ["{chan}"] = 0, ["{rate}"] = 0, ["{link}"] = 0, + ["{linp}"] = 0, ["{sign}"] = 0 } @@ -67,6 +69,9 @@ local function worker(format, warg) winfo["{sign}"] = -- Signal level can be a negative value, don't display decibel notation tonumber(string.match(iw, "Signal level[=:]([%-]?[%d]+)") or winfo["{sign}"]) + -- Link quality percentage if quality was available + if winfo["{link}"] ~= 0 then winfo["{linp}"] = math.ceil(winfo["{link}"] / 0.7) end + return winfo end -- }}} From 304fa336ed385942ad41178dc9d0b15e71d1ac2f Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sun, 24 Oct 2010 23:36:38 +0200 Subject: [PATCH 3/9] wifi: properly handle disconnects --- widgets/wifi.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/widgets/wifi.lua b/widgets/wifi.lua index 9e8583a..4f389d0 100644 --- a/widgets/wifi.lua +++ b/widgets/wifi.lua @@ -22,21 +22,21 @@ local string = { module("vicious.widgets.wifi") --- Initialize function tables -local winfo = { - ["{ssid}"] = "N/A", - ["{mode}"] = "N/A", - ["{chan}"] = 0, - ["{rate}"] = 0, - ["{link}"] = 0, - ["{linp}"] = 0, - ["{sign}"] = 0 -} - -- {{{ Wireless widget type local function worker(format, warg) if not warg then return end + -- Default values + local winfo = { + ["{ssid}"] = "N/A", + ["{mode}"] = "N/A", + ["{chan}"] = 0, + ["{rate}"] = 0, + ["{link}"] = 0, + ["{linp}"] = 0, + ["{sign}"] = 0 + } + -- Get data from iwconfig where available local iwconfig = "/sbin/iwconfig" local f = io.open(iwconfig, "rb") From 82eb67b40025608aa856322c9c475dc59577b4d8 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Thu, 28 Oct 2010 20:16:18 +0200 Subject: [PATCH 4/9] wifi: removed spurious bracket from SSID regexp --- widgets/wifi.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/wifi.lua b/widgets/wifi.lua index 4f389d0..f2e2b7d 100644 --- a/widgets/wifi.lua +++ b/widgets/wifi.lua @@ -57,7 +57,7 @@ local function worker(format, warg) -- Output differs from system to system, some stats can be -- separated by =, and not all drivers report all stats winfo["{ssid}"] = -- SSID can have almost anything in it - string.match(iw, 'ESSID[=:]"([%w%p]+[%s%w%p]*]*)"') or winfo["{ssid}"] + string.match(iw, 'ESSID[=:]"([%w%p]+[%s%w%p]*)"') or winfo["{ssid}"] winfo["{mode}"] = -- Modes are simple, but also match the "-" in Ad-Hoc string.match(iw, "Mode[=:]([%w%-]*)") or winfo["{mode}"] winfo["{chan}"] = -- Channels are plain digits From 7f7a94d7959c970937c803f19416494cb55ae1e3 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Fri, 29 Oct 2010 16:46:59 +0200 Subject: [PATCH 5/9] gmail: inbox is now default With all the tags and other crap, we could be counting mail up to 3-5 times. If you hate this change let me know. Otherwise inbox is now default. --- widgets/gmail.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/gmail.lua b/widgets/gmail.lua index c772be8..2e3764d 100644 --- a/widgets/gmail.lua +++ b/widgets/gmail.lua @@ -37,7 +37,7 @@ local rss = { } -- Default is all unread -local feed = rss.unread +local feed = rss.inbox local mail = { ["{count}"] = 0, ["{subject}"] = "N/A" From 762593385c2492e630946b9253083367bee19181 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Fri, 29 Oct 2010 17:50:13 +0200 Subject: [PATCH 6/9] wifi: proper fix for SSID regexp --- widgets/wifi.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/widgets/wifi.lua b/widgets/wifi.lua index f2e2b7d..3e30dc9 100644 --- a/widgets/wifi.lua +++ b/widgets/wifi.lua @@ -7,6 +7,7 @@ local tonumber = tonumber local math = { ceil = math.ceil } local setmetatable = setmetatable +local helpers = require("vicious.helpers") local io = { open = io.open, popen = io.popen @@ -57,7 +58,7 @@ local function worker(format, warg) -- Output differs from system to system, some stats can be -- separated by =, and not all drivers report all stats winfo["{ssid}"] = -- SSID can have almost anything in it - string.match(iw, 'ESSID[=:]"([%w%p]+[%s%w%p]*)"') or winfo["{ssid}"] + helpers.escape(string.match(iw, 'ESSID[=:]"(.-)"') or winfo["{ssid}"]) winfo["{mode}"] = -- Modes are simple, but also match the "-" in Ad-Hoc string.match(iw, "Mode[=:]([%w%-]*)") or winfo["{mode}"] winfo["{chan}"] = -- Channels are plain digits From fe2e4326856f66275d0884e617543ee4537eaf6e Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Wed, 3 Nov 2010 03:21:56 +0100 Subject: [PATCH 7/9] TODO: fix contrib/sensors for Ian --- TODO | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TODO b/TODO index 08945ab..0f77dfd 100644 --- a/TODO +++ b/TODO @@ -16,6 +16,9 @@ - Shortening the match introduced new problems IIRC ** TODO Expand raid to grab data for all available devices ** TODO Add fan speed to thermal.lua +** TODO Fix contrib/sensors for Ian + - > it does work and provides the lm_sensors + > information but only for one cpu core. ** TODO Return values of type number in NET and FS - Note: tonumber() strips decimal points ** MAYBE Simplify scrolling using negative margins + fixed width From add54f87ee5634fa4e247b16df13d5687a49ca79 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Wed, 3 Nov 2010 03:33:49 +0100 Subject: [PATCH 8/9] README: added missing register() documentation --- README | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README b/README index 54ca144..cbdac48 100644 --- a/README +++ b/README @@ -38,7 +38,7 @@ Then add the following to the top of your rc.lua: require("vicious") Once you create a widget (a textbox, graph or a progressbar) call -vicious.register() to register it with vicious: +vicious.register() to register it with Vicious: vicious.register(widget, wtype, format, interval, warg) @@ -270,7 +270,7 @@ vicious.widgets.date - takes optional time offset, in seconds, as an argument for example to calculate time zone differences, otherwise current time is formatted - - returns the output of os.date(), formatted by provided sequences + - returns the output of os.date, formatted by provided sequences Custom widget types @@ -292,6 +292,12 @@ branch. If you are also a BSD user you can find his work here: - http://git.sigil.org/vicious-fbsd/ +Some users would like to avoid writing new modules. For them Vicious +kept the old Wicked functionality, possibility to register their own +functions as widget types. By providing them as the second argument to +vicious.register. Your function can accept "format" and "warg" +arguments, just like workers. + Power and Caching ----------------- From 5160cfe8e94c0277f4dc27dad31024e11ccc4e08 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Tue, 30 Nov 2010 02:34:54 +0100 Subject: [PATCH 9/9] Next release, tag 2.0.2 --- CHANGES | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CHANGES b/CHANGES index 255a53b..abe1840 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,30 @@ Full changelog is available online: http://git.sysphere.org/vicious/log/?showmsg=1 --------------------------------------------------- +add54f8 README: added missing register() documentation +fe2e432 TODO: fix contrib/sensors for Ian +7625933 wifi: proper fix for SSID regexp +7f7a94d gmail: inbox is now default +82eb67b wifi: removed spurious bracket from SSID regexp +304fa33 wifi: properly handle disconnects +32a7be1 wifi: provide link quality in percent +c532c0b contrib: fixed email of pulse widget author +49b0913 wifi: improved SSID regular expression +932bd8d init: emit timeout instead of forced update +fbd2af7 init: add set_markup support +e51d8ac date: turn time widget argument into an offset +c6085ee date: accept time as a widget argument +a9d6ea2 init: add connect_signal support, patch by Uli +86a1394 README: update contrib information +fbfcc49 init: comment connect_signal for users of awesome master +1d7f646 pkg: description updated +88c3d0c contrib: use pcall for luasocket in pop +b200a80 contrib: dont import pop - requires luasocket +0350ec9 TODO: document contrib widgets +f8a8696 contrib: imported POP3 widget from Boris +1a443cd init: import contrib widgets, commented +26b0395 contrib: imported contrib widgets +0d6333e Next release, tag 2.0.1 1534951 mpd: added some optional stats, commented 4113d37 pkg: include FreeBSD support fc46e7a TODO: solid multigraph support needed