Skip to content

Instantly share code, notes, and snippets.

@Saakshaat
Created August 6, 2020 23:09
Show Gist options
  • Save Saakshaat/71106aa60e2ab547b019dc075ed9daa8 to your computer and use it in GitHub Desktop.
Save Saakshaat/71106aa60e2ab547b019dc075ed9daa8 to your computer and use it in GitHub Desktop.
Simple script and cron job for ad skips on spotify
# make sure that it's executable by chmod +x check_if_spotify_is_running
if pgrep Spotify; then
osascript -e 'quit application "spotify"'
echo 'Restarting'
sleep 2s
osascript -e 'tell application "spotify" to play'
else
echo 'All good';
fi
This runs the check_if_spotify_is_running script every 15 minutes, which checks if spotify is running or not and restarts it if it is (restarting makes the ads go away 🤭)
*/15 * * * * /usr/local/bin/check_if_spotify_is_running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment