A drop-in replacement for statusd_mpd.lua which uses sockets instead of
popen to communicate with mpd.  Suggest renaming to replace the other
script.

Requires LuaSocket 
(http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/home.html)

I've been having difficulty with the existing statusd_mpd.  In
particular, the existing script frequently but fairly randomly causes
the statusbar to fail to load, necessitating multiple restarts of ion3
before it behaves properly.

This replacement sets a short timer at startup and exits quickly, which
seems to help with the problem I was experiencing: if it's slow to open
a connection to mpd, it will not bring down the entire statusbar.

It also follows Tuomo's suggestion of using sockets rather than running
a program with popen every half-second.  This should be less overhead
for the system.  It does tie up one of your mpd connections permanently,
however, so you may need to make sure max_connections is high enough to
support it.  If you're running out of connections, though, it's more
likely that you have a whole bunch of redundant ion-statusd processes
hanging out doing nothing.

I've also added %artist_or_album, which I use so tracks from Broadway
shows are displayed reasonably in my collection.  There might be a
better way to do this, but I haven't come up with anything I like.

Comments welcome, particularly if there are any situations in which it
can get hung up holding an open socket of which I'm unaware.

Attachment: statusd_mpd-socket.lua
Description: Binary data

Attachment: signature.asc
Description: PGP signature

Reply via email to