You are not logged in.
In my panel script, to get music information:
while true; do
mpc idle player >/dev/null
#do things
done
This works well when there are no errors - every time something updates in mpd, my panel updates its information.
However, at the rare occation that mpd is down, mpc idle player throws an error, like "error: Connection refuses". This wakes mpc idle player instantly up from its wait and finishes the iteration, which repeats the process in an evil circle and causes a resource-hungry loop.
One solution I think, is to check if mpc throws an error, then sleep if it does. However, I'm unsure how to do that. $(mpc idle player) does indeed not output if the text is stderr, and I've run out of immediate ideas as I'm fairly nooby.
Thanks.
Offline