From 8c459ba781d6526509499ad2d1856d2424ed1014 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Sun, 4 Sep 2016 19:06:28 +0700 Subject: [PATCH 1/4] Added support for Rhythmbox Music Player --- neofetch | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 7a097b80..58feadc7 100755 --- a/neofetch +++ b/neofetch @@ -1223,16 +1223,24 @@ getsong() { song="$(osascript -e 'tell application "iTunes" to artist of current track as string & " - " & name of current track as string')" state="$(osascript -e 'tell application "iTunes" to player state as string')" + elif [ -n "$(ps x | awk '!(/awk/) && /rhythmbox/')" ]; then + song="$(rhythmbox-client --print-playing)" + # Well, what can you expect? It's dbus after all. + state="$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 \ + org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string: 'PlayBackStatus' |\ + awk -F 'string "' '{printf $2}')" + state="${state//\"}" + else song="Not Playing" fi case "$state" in - "paused" | "PAUSE") + "paused" | "PAUSE" | "Paused") song="Paused" ;; - "stopped" | "STOP") + "stopped" | "STOP" | "Stopped") song="Stopped" ;; esac From fb4638f1af9ddd3966cdbe2a17b0f406ccb23c95 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Sun, 4 Sep 2016 19:28:08 +0700 Subject: [PATCH 2/4] Added support for Banshee Music Player --- neofetch | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neofetch b/neofetch index 58feadc7..f2290aed 100755 --- a/neofetch +++ b/neofetch @@ -1231,6 +1231,12 @@ getsong() { awk -F 'string "' '{printf $2}')" state="${state//\"}" + elif [ -n "$(ps x | awk '!(/awk/) && /banshee/')" ]; then + artist="$(banshee --query-artist | awk -F':' '{print $2}')" + title="$(banshee --query-title | awk -F':' '{print $2}')" + song="$artist - $title" + state="$(banshee --query-current-state | awk -F':' '{print $2}')" + else song="Not Playing" fi From 7a7e7aeb1f3f887b0461e640763fa6f5c9b34d3e Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Wed, 7 Sep 2016 23:02:45 +0700 Subject: [PATCH 3/4] Added support for Amarok --- neofetch | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/neofetch b/neofetch index f2290aed..6c1a8981 100755 --- a/neofetch +++ b/neofetch @@ -1237,6 +1237,11 @@ getsong() { song="$artist - $title" state="$(banshee --query-current-state | awk -F':' '{print $2}')" + elif [ -n "$(ps x | awk '!(/awk/) && /amarok/')" ]; then + artist="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {print $2}')" + title="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/title/ {print $2}')" + song="$artist - $title" + else song="Not Playing" fi From 42048570d434bdf28317c2e3448f7eb869de4cf3 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Sun, 11 Sep 2016 23:37:23 +0700 Subject: [PATCH 4/4] Added support for deadbeef --- neofetch | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neofetch b/neofetch index 6c1a8981..10eb6237 100755 --- a/neofetch +++ b/neofetch @@ -1242,6 +1242,9 @@ getsong() { title="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/title/ {print $2}')" song="$artist - $title" + elif [ -n "$(ps x | awk '!(/awk/) && /deadbeef/')" ]; then + song="$(deadbeef --nowplaying '%a - %t')" + else song="Not Playing" fi