From 15349516ca5b8ff46a7bb2261663ec9dab480273 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sun, 22 Aug 2010 14:59:05 +0200 Subject: [PATCH] mpd: added some optional stats, commented --- README | 2 +- TODO | 1 - widgets/mpd.lua | 6 +++++- 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