Song: Remove duplicate blocks
This commit is contained in:
parent
98d2421b8b
commit
ca8c45b668
32
neofetch
32
neofetch
|
@ -1219,32 +1219,16 @@ get_song() {
|
|||
song="$(audtool current-song)"
|
||||
;;
|
||||
|
||||
"gnome-music"*)
|
||||
"gnome-music"* | "lollypop"* | "clementine"*)
|
||||
case "$player" in
|
||||
"gnome-music"*) player="GnomeMusic" ;;
|
||||
"lollypop"*) player="Lollypop" ;;
|
||||
"clementine"*) player="clementine" ;;
|
||||
esac
|
||||
|
||||
# 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% - }"
|
||||
;;
|
||||
|
||||
"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 " - "}'
|
||||
|
|
Reference in New Issue