Created
August 6, 2020 23:09
-
-
Save Saakshaat/71106aa60e2ab547b019dc075ed9daa8 to your computer and use it in GitHub Desktop.
Simple script and cron job for ad skips on 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
# 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 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
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