Skip to content

Instantly share code, notes, and snippets.

@michaellunzer
Created December 15, 2016 22:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaellunzer/939971417bf6dd5bfbaa0dced969a663 to your computer and use it in GitHub Desktop.
Save michaellunzer/939971417bf6dd5bfbaa0dced969a663 to your computer and use it in GitHub Desktop.
# this is a simple bash script to load up a hard coded spotify url and play it
# make sure to make the file excutable (chmod 777 autostart_music.sh)
# to add it on boot, look here: https://www.raspberrypi.org/documentation/linux/usage/rc-local.md
# Made by LUNZCORP
mpc clear # this clears any loaded music
mpc random on
mpc repeat on
mpc volume 20 # Sets the volume to 20%, usually it is 85% -- this is to prevent ears & speakers getting blown out
mpc add spotify:user:1257169155:playlist:6v5GsliUA8B1KRWk3ODxeZ # add the spotify URL ... on the desktop right click the playlist in the spotify app -> copy playlist URL
mpc play # will play the music
mpc volume 40 # increases the volume
sleep 1
mpc volume 85
sleep 5 # not necessary
mpc status #shows you what is playing, volume, progress, etc. you can remove this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment