Song: Don't print empty song generally
This commit is contained in:
parent
286b343a89
commit
8e32dc78f7
8
neofetch
8
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/ -*}"
|
||||
|
|
Reference in New Issue