From 75cd1039cfa33f502485c6a7f70be747213bfe84 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sat, 9 Nov 2013 23:52:43 +0100 Subject: Revert "mpd: workaround command termination bug in mpd server v0.18" This reverts commit a6a73f47, because the issue was solved in mpd release 0.18.2. I imported the workaround for historical reasons and in case someone gets stuck with version 0.18 on his preferred OS distribution. --- widgets/mpd.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'widgets') diff --git a/widgets/mpd.lua b/widgets/mpd.lua index b8d08df..e4bcb0b 100644 --- a/widgets/mpd.lua +++ b/widgets/mpd.lua @@ -37,11 +37,10 @@ local function worker(format, warg) -- Construct MPD client options local mpdh = "telnet://"..host..":"..port - local echo = '{ echo "password '..pass..'"; echo "status";' .. - 'echo "currentsong"; sleep .1; echo "close";}' + local echo = "echo 'password "..pass.."\nstatus\ncurrentsong\nclose'" -- Get data from MPD server - local f = io.popen(echo.." | curl --connect-timeout 1 -fs "..mpdh) + local f = io.popen(echo.." | curl --connect-timeout 1 -fsm 3 "..mpdh) for line in f:lines() do for k, v in string.gmatch(line, "([%w]+):[%s](.*)$") do -- cgit v1.2.3