aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-08-22 14:59:05 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-08-22 14:59:05 +0200
commit15349516ca5b8ff46a7bb2261663ec9dab480273 (patch)
treeca2bce2c40a3f6b4e6c2f94d58be2d17cb56d684
parent4113d371d17087887f2a9a0ae51a20dd4dd3cadf (diff)
downloadvicious-legacy-15349516ca5b8ff46a7bb2261663ec9dab480273.tar.xz
mpd: added some optional stats, commented
-rw-r--r--README2
-rw-r--r--TODO1
-rw-r--r--widgets/mpd.lua6
3 files changed, 6 insertions, 3 deletions
diff --git a/README b/README
index a8b2dab..48ff235 100644
--- a/README
+++ b/README
@@ -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
diff --git a/TODO b/TODO
index 1d65379..7e4947c 100644
--- a/TODO
+++ b/TODO
@@ -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
diff --git a/widgets/mpd.lua b/widgets/mpd.lua
index 009ae7d..0ed0132 100644
--- a/widgets/mpd.lua
+++ b/widgets/mpd.lua
@@ -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