mpd: added some optional stats, commented

This commit is contained in:
Adrian C. (anrxc) 2010-08-22 14:59:05 +02:00
parent 4113d371d1
commit 15349516ca
3 changed files with 6 additions and 3 deletions

2
README
View File

@ -249,7 +249,7 @@ vicious.widgets.mpd
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}
{Title}, {Album}, {Genre} and optionally {Name} and {file}
vicious.widgets.volume
- provides volume levels and state of requested ALSA mixers

1
TODO
View File

@ -9,7 +9,6 @@
** TODO Consider including this code in format helper
- return format and format:gsub("${[^}]+}", "")
- Note: We should then also replace just $1/$2...
** TODO Include Name and file in MPD widget
** TODO Complete the hddtemp fix
- In certain setups regexp does not match all devices
- The regexp catches the first device name, but last stats

View File

@ -24,7 +24,9 @@ local function worker(format, warg)
["{Artist}"] = "N/A",
["{Title}"] = "N/A",
["{Album}"] = "N/A",
["{Genre}"] = "N/A"
["{Genre}"] = "N/A",
--["{Name}"] = "N/A",
--["{file}"] = "N/A",
}
-- Fallback to MPD defaults
@ -47,6 +49,8 @@ local function worker(format, warg)
elseif k == "Title" then mpd_state["{"..k.."}"] = helpers.escape(v)
elseif k == "Album" then mpd_state["{"..k.."}"] = helpers.escape(v)
elseif k == "Genre" then mpd_state["{"..k.."}"] = helpers.escape(v)
--elseif k == "Name" then mpd_state["{"..k.."}"] = helpers.escape(v)
--elseif k == "file" then mpd_state["{"..k.."}"] = helpers.escape(v)
end
end
end