|
|
|
|
@ -1219,32 +1219,16 @@ get_song() { |
|
|
|
|
song="$(audtool current-song)" |
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
"gnome-music"*) |
|
|
|
|
# Hello dbus my old friend. |
|
|
|
|
song="$(\ |
|
|
|
|
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.GnomeMusic /org/mpris/MediaPlayer2 \ |
|
|
|
|
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' |\ |
|
|
|
|
awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\ |
|
|
|
|
awk -F '"' '/artist|title/ {printf $2 " - "}' |
|
|
|
|
)" |
|
|
|
|
song="${song% - }" |
|
|
|
|
;; |
|
|
|
|
"gnome-music"* | "lollypop"* | "clementine"*) |
|
|
|
|
case "$player" in |
|
|
|
|
"gnome-music"*) player="GnomeMusic" ;; |
|
|
|
|
"lollypop"*) player="Lollypop" ;; |
|
|
|
|
"clementine"*) player="clementine" ;; |
|
|
|
|
esac |
|
|
|
|
|
|
|
|
|
"lollypop"*) |
|
|
|
|
# Hello dbus my old friend. |
|
|
|
|
song="$(\ |
|
|
|
|
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.Lollypop /org/mpris/MediaPlayer2 \ |
|
|
|
|
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' |\ |
|
|
|
|
awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\ |
|
|
|
|
awk -F '"' '/artist|title/ {printf $2 " - "}' |
|
|
|
|
)" |
|
|
|
|
song="${song% - }" |
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
"clementine"*) |
|
|
|
|
# dbus |
|
|
|
|
song="$( |
|
|
|
|
dbus-send --print-reply --dest=org.mpris.clementine /org/mpris/MediaPlayer2 \ |
|
|
|
|
dbus-send --print-reply --dest=org.mpris.MediaPlayer2."${player}" /org/mpris/MediaPlayer2 \ |
|
|
|
|
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' |\ |
|
|
|
|
awk -F 'string "' '/string|array/ {printf "%s",$2; next}{print ""}' |\ |
|
|
|
|
awk -F '"' '/artist|title/ {printf $2 " - "}' |
|
|
|
|
|