From 02dba8b36a555276f40761bcc8c8e8a388b027c6 Mon Sep 17 00:00:00 2001 From: Jack Pugmire Date: Thu, 15 Jan 2015 23:44:22 -0500 Subject: [PATCH] Added keys to mpd_now for querying the length of a song and the current time (both in seconds). --- widgets/mpd.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/widgets/mpd.lua b/widgets/mpd.lua index 7fd611d..99624a2 100644 --- a/widgets/mpd.lua +++ b/widgets/mpd.lua @@ -58,7 +58,9 @@ local function worker(args) artist = "N/A", title = "N/A", album = "N/A", - date = "N/A" + date = "N/A", + time = "N/A", + elapsed= "N/A" } for line in f:lines() do @@ -69,6 +71,8 @@ local function worker(args) elseif k == "Title" then mpd_now.title = escape_f(v) elseif k == "Album" then mpd_now.album = escape_f(v) elseif k == "Date" then mpd_now.date = escape_f(v) + elseif k == "Time" then mpd_now.time = v + elseif k == "elapsed"then mpd_now.elapsed= math.floor(v) end end end -- 2.39.5