diff --git a/neofetch b/neofetch index da1b95ad..f22352f8 100755 --- a/neofetch +++ b/neofetch @@ -1251,15 +1251,15 @@ get_song() { ;; "banshee"*) - song="$(banshee --query-artist --query-title | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')" + song="$(banshee --query-artist --query-title | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')" ;; "amarok"*) - song="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')" + song="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')" ;; "pragha"*) - song="$(pragha -c | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')" + song="$(pragha -c | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')" ;; "exaile"*) @@ -1268,6 +1268,8 @@ get_song() { ;; esac + [[ "$(trim "$song")" = "-" ]] && unset -v song + # Display Artist and Title on separate lines. if [[ "$song_shorthand" == "on" ]]; then artist="${song/ -*}"