Created
July 22, 2015 10:38
-
-
Save nongio-zz/38258c7fc0e58ff79081 to your computer and use it in GitHub Desktop.
check current status of spotify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
state=`osascript -e 'tell application "Spotify" to player state as string'`; | |
if [ $state = "playing" ]; then | |
current=`osascript -e 'tell application "Spotify"' -e 'set currentArtist to artist of current track as string' -e 'set currentTrack to name of current track as string' -e 'return currentArtist & " - " & currentTrack' -e 'end tell'`; | |
echo "$current ๐ "; | |
else | |
echo "๐" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment