Ubuntu 18.04, conky 1.10.8.
I have an internet radio player application called "Goodvibes" installed.
I have a conky "script" (correct term?) running. When Goodvibes is running, but the Goodvibes' state is "Stopped", then the conky script produces a message on the desktop that says, "Goodvibes is not playing." When Goodvibes' state is "Playing", then the conky script produces this output: The name of the station that is playing, the artist and track that is playing, , and the volume level and a volume bar. This all works fine.
The problem is when Goodvibes is not even running. In this case, the conky script produces a message on the desktop that says, "Goodvibes is not playing." That is what I want. However..... In this case conky is also flooding an error log with this message every three seconds: "Service org.mpris.MediaPlayer2.Goodvibes is not running."
I show the relevent section of the conky script below. I believe the problem is that, even though Goodvibes is not running, the execi and execpi commands in the conky script are still being "evaluated", but because Goodvibes is not running, I am getting these error messages.
Goodvibes works, and the conky script works - I'm just trying to modify the conky script so that when Goodvibes is not running, I still get the output of "Goodvibes is not playing", but without all the error messages about the service org.mpris.MediaPlayer2.Goodvibes not running.
How do I modify this conky script to accomplish that?
conky.text = [[
${if_match "${execi 3 qdbus org.mpris.MediaPlayer2.Goodvibes /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlaybackStatus}" == "Playing"}
${color2}Goodvibes Info
Station: ${color0}${execpi 3 qdbus org.mpris.MediaPlayer2.Goodvibes /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep "^goodvibes:station:" | cut -d':' -f3-}
${color2}Artist - Track: ${color0}${execpi 3 qdbus org.mpris.MediaPlayer2.Goodvibes /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata | grep "^xesam:title:" | cut -d':' -f3-}
${else}
${color2}Goodvibes is not playing.${color0}
${endif}
${color2}Volume (0 - 64): ${color0}${exec amixer -c 1 get Master | grep Mono:}
${color0} ${execbar amixer -c 1 get Master | grep -o -E '[0-9]{2}' | head -n3 | tail -n1}
]]
Bookmarks