diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2010-03-12 21:56:17 +0100 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2010-03-12 21:56:17 +0100 |
commit | 8482b5407cf1a17b39ce7d2b992acd13a893da25 (patch) | |
tree | 45b8e28779e692e26ddc0282c685068cde9e396f /README | |
parent | dda51b1e34c3c3e5f8fe7f08616e125812da1d5b (diff) | |
download | vicious-legacy-8482b5407cf1a17b39ce7d2b992acd13a893da25.tar.xz |
mpd: rewritten and now uses curl not mpc
Widget type uses curl now, like all other types accessing network
resources (until, if ever, we switch to luasocket). Where previously
only the currently playing song was returned now you can access these
keys: {volume}, {state}, {Artist}, {Title}, {Album}, {Genre}. You can
provide an optional table argument to change password, host or port.
Diffstat (limited to 'README')
-rw-r--r-- | README | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -131,7 +131,6 @@ great for saving power. Security -------- - At the moment only one widget type (Gmail) requires auth. information in order to get to the data. In the future there could be more, and you should give some thought to the issue of protecting your data. The @@ -299,11 +298,13 @@ vicious.widgets.pkg - returns 1st value as the count of available updates vicious.widgets.mpd - - provides the currently playing song in MPD - - takes an (optional) argument, if it's a number song name will be - truncated, if a table, with 1st field as maximum lenght and 2nd - the widget name (i.e. "mpdwidget"), scrolling will be used - - returns 1st value as the currently playing song + - provides Music Player Daemon information + - takes a table as an argument, 1st field should be the password (or + nil), 2nd the hostname (or nil) and 3rd port (or nil) - if no + argument is provided connection attempt will be made to localhost + port 6600 with no password + - returns a table with string keys: {volume}, {state}, {Artist}, + {Title}, {Album}, {Genre} vicious.widgets.volume - provides volume levels and state of requested ALSA mixers @@ -413,11 +414,12 @@ second argument, and will return the text/data to be used for the widget. Example - mpdwidget = widget({ type = 'textbox' }) - vicious.register(mpdwidget,vicious.widgets.mpd, + mpdwidget = widget({ type = "textbox" }) + vicious.register(mpdwidget, vicious.widgets.mpd, function (widget, args) - if args[1] == 'Stopped' then return '' - else return '<span color="white">MPD:</span> '..args[1] + if args["{state}"] == "Stop" then return "" + else return '<span color="white">MPD:</span> '.. + args["{Artist}"]..' - '.. args["{Title}"] end end) |