This is an MPRIS Player wrapper around the Spotify Web APIs.
It has very limitted functionality since it's only goal is to integrate with MPRIS.
For more advance actions, I'd recommend checking out spotify-tui.
Designed mostly to be used with librespot. To have integration with
playerctl
and gnome-shell
.
Uses node v18 or higher.
npm install
npm run build
npm link
- Go to Spotify Developer Dashboard and create a new app.
- Add the desired callback uri in the app (with the desired port)
- Copy the Client ID into spotdjs.conf
- Store the Client secret
secret-tool store --label='custom-label' service spotdjs account CLIENT_ID
- Set up the port number and redirect url
- Copy the
spotdjs.conf
to~/.config/spotdjs/spotdjs.conf
When running librespot, configure it to call the callback script:
librespot --onevent "~/GitHub/spotdjs/librespothandler.sh" # other options...
On the first run, it won't work since we haven't actually authenticated yet, but will output a link to authenticate with Spotify. Click that link and sign in to authorize spotdjs to be able to read playback state, modify playback sate, and read currently playing.