From 7e445aa0624ab22c4bd6562925332b907cc92b59 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Tue, 15 Nov 2016 21:43:24 +0700 Subject: [PATCH 1/2] Music: Added support for GNOME Music --- neofetch | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 98c147d4..3797fc7d 100755 --- a/neofetch +++ b/neofetch @@ -1076,7 +1076,7 @@ get_memory() { get_song() { # This is absurdly long. - player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious/ {printf $5 " " $6; exit}')" + player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|gnome-music/ {printf $5 " " $6; exit}')" case "${player/*\/}" in "mpd"*) @@ -1160,6 +1160,17 @@ 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% - }" + ;; + *) song="Not Playing" ;; esac From 2581fbd8d8ef3b43adc6c1322f83e379f978d43f Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Tue, 15 Nov 2016 21:44:59 +0700 Subject: [PATCH 2/2] Music: Added support for Lollypop --- neofetch | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 3797fc7d..d19f90a7 100755 --- a/neofetch +++ b/neofetch @@ -1076,7 +1076,7 @@ get_memory() { get_song() { # This is absurdly long. - player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|gnome-music/ {printf $5 " " $6; exit}')" + player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|gnome-music|lollypop/ {printf $5 " " $6; exit}')" case "${player/*\/}" in "mpd"*) @@ -1171,6 +1171,17 @@ get_song() { 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% - }" + ;; + *) song="Not Playing" ;; esac