This commit is contained in:
Dylan Araps 2016-10-26 18:22:08 +11:00
parent 0c41c285a7
commit 43ac9dfcb2
1 changed files with 2 additions and 1 deletions

View File

@ -1120,6 +1120,7 @@ getmemory() {
# Song {{{ # Song {{{
getsong() { getsong() {
# 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/ {printf $5 " " $6; exit}')"
case "${player/*\/}" in case "${player/*\/}" in
@ -1176,7 +1177,7 @@ getsong() {
"rhythmbox"*) "rhythmbox"*)
song="$(rhythmbox-client --print-playing)" song="$(rhythmbox-client --print-playing)"
# Well, what can you expect? It's dbus after all. # Thanks dbus
state="$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 \ 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' |\ org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string: 'PlayBackStatus' |\
awk -F 'string "' '{printf $2}')" awk -F 'string "' '{printf $2}')"