diff options
author | joe di castro <joe@joedicastro.com> | 2013-11-05 21:08:42 +0100 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2013-11-08 17:57:53 +0100 |
commit | a6a73f47d6be78e083e96829efa3f03752f3f539 (patch) | |
tree | c6fee7793f0625ac99346114e6435079ce34900f /widgets | |
parent | c795642c2ff03e451ecebae05f787933da5fa5ed (diff) | |
download | vicious-legacy-a6a73f47d6be78e083e96829efa3f03752f3f539.tar.xz |
mpd: workaround command termination bug in mpd server v0.18
See Debian bug report #728982 for more information.
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/mpd.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/widgets/mpd.lua b/widgets/mpd.lua index e4bcb0b..b8d08df 100644 --- a/widgets/mpd.lua +++ b/widgets/mpd.lua @@ -37,10 +37,11 @@ local function worker(format, warg) -- Construct MPD client options local mpdh = "telnet://"..host..":"..port - local echo = "echo 'password "..pass.."\nstatus\ncurrentsong\nclose'" + local echo = '{ echo "password '..pass..'"; echo "status";' .. + 'echo "currentsong"; sleep .1; echo "close";}' -- Get data from MPD server - local f = io.popen(echo.." | curl --connect-timeout 1 -fsm 3 "..mpdh) + local f = io.popen(echo.." | curl --connect-timeout 1 -fs "..mpdh) for line in f:lines() do for k, v in string.gmatch(line, "([%w]+):[%s](.*)$") do |