Song: Fix iTunes 2

This commit is contained in:
Dylan Araps 2016-10-26 21:18:46 +11:00
parent 9889ba14cb
commit 6f41167eb5

View file

@ -1121,7 +1121,7 @@ getmemory() {
getsong() { getsong() {
# This is absurdly long. # This is absurdly long.
player="$(ps x | awk '!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes|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
"mpd"*) "mpd"*)
@ -1170,7 +1170,7 @@ getsong() {
state="$(gpmdp-remote status 2>/dev/null)" state="$(gpmdp-remote status 2>/dev/null)"
;; ;;
"itunes.app"*) "itunes"*)
song="$(osascript -e 'tell application "iTunes" to artist of current track as string & " - " & name of current track as string')" 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')" state="$(osascript -e 'tell application "iTunes" to player state as string')"
;; ;;