X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/0594fb0ebdfa65f1a15b820b9690d5802e82ad1b..70bee86b8b4e796a7f399f5d795b080ae8f3a4f6:/widgets/mpd.lua diff --git a/widgets/mpd.lua b/widgets/mpd.lua index d5f07a8..1972050 100644 --- a/widgets/mpd.lua +++ b/widgets/mpd.lua @@ -59,6 +59,7 @@ local function worker(args) mpd_now = { state = "N/A", file = "N/A", + name = "N/A", artist = "N/A", title = "N/A", album = "N/A", @@ -67,10 +68,11 @@ local function worker(args) elapsed = "N/A" } - for line in f:lines() do + for line in string.gmatch(f, "[^\n]+") do for k, v in string.gmatch(line, "([%w]+):[%s](.*)$") do if k == "state" then mpd_now.state = v elseif k == "file" then mpd_now.file = v + elseif k == "Name" then mpd_now.name = escape_f(v) elseif k == "Artist" then mpd_now.artist = escape_f(v) elseif k == "Title" then mpd_now.title = escape_f(v) elseif k == "Album" then mpd_now.album = escape_f(v)