Merge pull request #983 from mstraube/song-dbus

song: simplify get_song_dbus
This commit is contained in:
Dylan Araps 2018-05-13 21:53:05 +00:00 committed by GitHub
commit b74c7a63d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2404,8 +2404,8 @@ get_song() {
dbus-send --print-reply --dest=org.mpris.MediaPlayer2."${1}" /org/mpris/MediaPlayer2 \
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' \
string:'Metadata' |\
awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\
awk -F '"' '/artist/ {a=$2} /album"/ {b=$2} /title/ {t=$2} END{print a " ‡ " b " ‡ " t}'
awk -F '"' 'BEGIN {RS=" entry"}; /xesam:artist/ {a = $4} /xesam:album/ {b = $4}
/xesam:title/ {t = $4} END {print a " ‡ " b " ‡ " t}'
)"
}