Song: Fix audacious fallback

This commit is contained in:
Dylan Araps 2017-02-19 10:42:45 +11:00
parent b952030011
commit 7afd5b2d22
1 changed files with 9 additions and 1 deletions

View File

@ -1290,7 +1290,6 @@ get_song() {
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist% - %title%')" ;; "deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist% - %title%')" ;;
"xmms2d"*) song="$(xmms2 current -f '${artist} - ${title}')" ;; "xmms2d"*) song="$(xmms2 current -f '${artist} - ${title}')" ;;
"qmmp"*) song="$(qmmp --nowplaying '%p - %t')" ;; "qmmp"*) song="$(qmmp --nowplaying '%p - %t')" ;;
"audacious"*) audtool current-song || get_song_dbus "audacious" ;;
"gnome-music"*) get_song_dbus "GnomeMusic" ;; "gnome-music"*) get_song_dbus "GnomeMusic" ;;
"lollypop"*) get_song_dbus "Lollypop" ;; "lollypop"*) get_song_dbus "Lollypop" ;;
"clementine"*) get_song_dbus "clementine" ;; "clementine"*) get_song_dbus "clementine" ;;
@ -1299,6 +1298,15 @@ get_song() {
"guayadeque"*) get_song_dbus "guayadeque" ;; "guayadeque"*) get_song_dbus "guayadeque" ;;
"yarock"*) get_song_dbus "yarock" ;; "yarock"*) get_song_dbus "yarock" ;;
"audacious"*)
song="$(audtool current-song)"
# Remove Album from 'Artist - Album - Title'
song="${song/-* -/-}"
[[ -z "$song" ]] && get_song_dbus "audacious"
;;
"cmus"*) "cmus"*)
song="$(cmus-remote -Q | awk '/tag artist/ {$1=$2=""; print; print " - "} /tag title/ {$1=$2=""; print}')" song="$(cmus-remote -Q | awk '/tag artist/ {$1=$2=""; print; print " - "} /tag title/ {$1=$2=""; print}')"
;; ;;