Commit 8e32dc78 authored by Michael Straube's avatar Michael Straube

Song: Don't print empty song generally

parent 286b343a
...@@ -1251,15 +1251,15 @@ get_song() { ...@@ -1251,15 +1251,15 @@ get_song() {
;; ;;
"banshee"*) "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"*) "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"*) "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"*) "exaile"*)
...@@ -1268,6 +1268,8 @@ get_song() { ...@@ -1268,6 +1268,8 @@ get_song() {
;; ;;
esac esac
[[ "$(trim "$song")" = "-" ]] && unset -v song
# Display Artist and Title on separate lines. # Display Artist and Title on separate lines.
if [[ "$song_shorthand" == "on" ]]; then if [[ "$song_shorthand" == "on" ]]; then
artist="${song/ -*}" artist="${song/ -*}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment