fix, when mpd server is on another host

This commit is contained in:
dawidd6 2017-01-23 22:21:43 +01:00
parent 6bb7126a57
commit 38cb68b2dd
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B
1 changed files with 4 additions and 0 deletions

View File

@ -1332,6 +1332,10 @@ get_song() {
song="$(dbus-send --print-reply --dest=net.sacredchao.QuodLibet /net/sacredchao/QuodLibet net.sacredchao.QuodLibet.CurrentSong |\
awk -F'"' '/artist/ {getline; a=$2} /title/ {getline; t=$2} END{print a " - " t}')"
;;
*)
if type -p mpc >/dev/null; then song="$(mpc current)"; fi
;;
esac
[[ "$(trim "$song")" = "-" ]] && unset -v song