From: Jack Pugmire Date: Fri, 16 Jan 2015 04:44:22 +0000 (-0500) Subject: Added keys to mpd_now for querying the length of a song and the current time (both... X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/7939cfcd90809aeb746d0def75f474c2433c182f Added keys to mpd_now for querying the length of a song and the current time (both in seconds). --- 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