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