Skip to content

Instantly share code, notes, and snippets.

@monzou
Created May 15, 2022 02: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 monzou/cfe57b67767b9d19535f6fe4227a69e6 to your computer and use it in GitHub Desktop.
Save monzou/cfe57b67767b9d19535f6fe4227a69e6 to your computer and use it in GitHub Desktop.
Random BGM by shpotify
readonly PLAYLIST_IDS=(
"37i9dQZF1DWZeKCadgRdKQ" # Pop Hits 2022
"37i9dQZEVXcWw7uVUBjiBh" # Discover Weekly
"37i9dQZF1DWZZbpkxU5t9L" # Weekly Buzz Tokyo
"37i9dQZF1DX2sKGHAy2dfC" # Disco Summer
)
PLAYLIST_ID=${PLAYLIST_IDS[$(($RANDOM % ${#PLAYLIST_IDS[*]}))]}
URI="spotify:playlist:$PLAYLIST_ID"
/opt/homebrew/bin/spotify play uri $URI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment