Don't use as many ps flags

This commit is contained in:
Dylan 2016-03-29 10:04:59 +11:00
parent aa6ed1b216
commit 97fc5f34b7

View file

@ -1163,7 +1163,7 @@ getsong () {
song="$(mocp -Q "%artist - %song" 2>/dev/null)"
state="$(mocp -Q "%state" 2>/dev/null)"
elif [ -n "$(ps aux | awk '!(/awk/) && /spotify/')" ]; then
elif [ -n "$(ps x | awk '!(/awk/) && /spotify/')" ]; then
case "$os" in
"Linux")
# This command is way too long
@ -1184,11 +1184,11 @@ getsong () {
;;
esac
elif [ -n "$(ps aux | awk '!(/awk/ || /Helper/) && /Google Play Music Desktop Player/')" ] && type -p gpmdp >/dev/null 2>&1; then
elif [ -n "$(ps x | awk '!(/awk/ || /Helper/) && /Google Play Music Desktop Player/')" ] && type -p gpmdp >/dev/null 2>&1; then
song="$(gpmdp current)"
state="$(gpmdp status)"
elif [ -n "$(ps aux | awk '!(/awk/ || /Helper/) && /iTunes/')" ]; then
elif [ -n "$(ps x | awk '!(/awk/ || /Helper/) && /iTunes/')" ]; then
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')"