Skip to content

Instantly share code, notes, and snippets.

@nongio-zz
Created July 22, 2015 10:38
Show Gist options
  • Save nongio-zz/38258c7fc0e58ff79081 to your computer and use it in GitHub Desktop.
Save nongio-zz/38258c7fc0e58ff79081 to your computer and use it in GitHub Desktop.
check current status of spotify
#!/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