This script has only been tested in Spotify version 1.0.25.127 running on Ubuntu 14.04. It's a quick and dirty implementation, but should work well in most cases.
- xdotool
- Run the
spotify-sac
script while Spotify is open and playing. - If the script is running, Spotify will stop playing (actually, it will pause) after the current song is finished.
- To cancel the monitoring, kill the script with
Ctrl-C
.