Merge pull request #142 from dylanaraps/song_fixes
Remove duplicate pgrep lines in getsong
This commit is contained in:
commit
f08ea4f0a8
1 changed files with 7 additions and 5 deletions
12
neofetch
12
neofetch
|
@ -1180,7 +1180,7 @@ getsong () {
|
||||||
song="$(mocp -Q "%artist - %song" 2>/dev/null)"
|
song="$(mocp -Q "%artist - %song" 2>/dev/null)"
|
||||||
state="$(mocp -Q "%state" 2>/dev/null)"
|
state="$(mocp -Q "%state" 2>/dev/null)"
|
||||||
|
|
||||||
elif pgrep "spotify" >/dev/null 2>&1; then
|
elif [ -n "$(ps aux | awk '!(/awk/) && /spotify/')" ]; then
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux")
|
"Linux")
|
||||||
# This command is way too long
|
# This command is way too long
|
||||||
|
@ -1194,15 +1194,17 @@ getsong () {
|
||||||
song=${song/'('*}
|
song=${song/'('*}
|
||||||
song=${song//'['*}
|
song=${song//'['*}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Mac OS X")
|
||||||
|
song="$(osascript -e 'tell application "Spotify" to artist of current track as string & " - " & name of current track as string')"
|
||||||
|
state="$(osascript -e 'tell application "Spotify" to player state as string')"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
elif [ -n "$(ps aux | awk '!(/awk/ || /Helper/) && /iTunes/')" ]; then
|
elif [ -n "$(ps aux | awk '!(/awk/ || /Helper/) && /iTunes/')" ]; then
|
||||||
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')"
|
||||||
|
|
||||||
elif [ -n "$(ps aux | awk '!(/awk/) && /spotify/')" ]; then
|
|
||||||
song="$(osascript -e 'tell application "Spotify" to artist of current track as string & " - " & name of current track as string')"
|
|
||||||
state="$(osascript -e 'tell application "Spotify" to player state as string')"
|
|
||||||
|
|
||||||
else
|
else
|
||||||
song="Unknown"
|
song="Unknown"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue