Merge pull request #1025 from mstraube/song

song: use get_song_dbus for amarok
This commit is contained in:
Dylan Araps 2018-06-09 06:40:33 +10:00 committed by GitHub
commit 34eacd561b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -2370,6 +2370,7 @@ get_song() {
"vlc"*) get_song_dbus "vlc" ;; "vlc"*) get_song_dbus "vlc" ;;
"gmusicbrowser"*) get_song_dbus "gmusicbrowser" ;; "gmusicbrowser"*) get_song_dbus "gmusicbrowser" ;;
"pragha"*) get_song_dbus "pragha" ;; "pragha"*) get_song_dbus "pragha" ;;
"amarok"*) get_song_dbus "amarok" ;;
"cmus"*) "cmus"*)
song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "}; song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "};
@ -2409,13 +2410,8 @@ get_song() {
END {print a " \n " b " \n "t}')" END {print a " \n " b " \n "t}')"
;; ;;
"amarok"*)
song="$(qdbus org.kde.amarok /Player GetMetadata |\
awk -F':' '/^artist:/ {a=$2} /^album:/ {b=$2} /^title:/ {t=$2}
END {print a " \n " b " \n " t}')"
;;
"exaile"*) "exaile"*)
# NOTE: Exaile >= 4.0.0 will support mpris2.
song="$(dbus-send --print-reply --dest=org.exaile.Exaile /org/exaile/Exaile \ song="$(dbus-send --print-reply --dest=org.exaile.Exaile /org/exaile/Exaile \
org.exaile.Exaile.Query | org.exaile.Exaile.Query |
awk -F':|,' '{if ($6 && $8 && $4) printf $6 " \n" $8 " \n" $4}')" awk -F':|,' '{if ($6 && $8 && $4) printf $6 " \n" $8 " \n" $4}')"