Merge pull request #138 from iandrewt/osx_songs
OSX: Added Itunes/Spotify support to getsong
This commit is contained in:
commit
2b2ef7591e
1 changed files with 8 additions and 0 deletions
8
neofetch
8
neofetch
|
@ -1139,6 +1139,14 @@ getsong () {
|
||||||
song=${song//'['*}
|
song=${song//'['*}
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
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')"
|
||||||
|
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