diff --git a/neofetch b/neofetch index 03dfc20f..11986ed0 100755 --- a/neofetch +++ b/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 " - "}'