Skip to content

Instantly share code, notes, and snippets.

@brendonjohn
Last active November 1, 2019 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendonjohn/add0de3db9d3bfbc80d2df320ac26505 to your computer and use it in GitHub Desktop.
Save brendonjohn/add0de3db9d3bfbc80d2df320ac26505 to your computer and use it in GitHub Desktop.
A script that actually plays the previous Spotify track.
#!/usr/bin/env bash
osascript -e 'tell application "Spotify" to set player position to 0'
osascript -e 'tell application "Spotify" to previous track'
echo -n -e "\033]0;previousTrack\007"
osascript -e 'tell application "Terminal" to close (every window whose name contains "previousTrack")' &
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment