From 670161e13a6733d75bd51f21aaea0a78a8fd3d06 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Fri, 11 May 2018 19:22:34 +0200 Subject: [PATCH] song: simplify get_song_dbus --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index ea4384b0..cfd2ecf1 100755 --- a/neofetch +++ b/neofetch @@ -2403,8 +2403,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}' )" }