hrkfdn / ncspot

Cross-platform ncurses Spotify client written in Rust, inspired by ncmpc and the likes.
BSD 2-Clause "Simplified" License
5.02k stars 209 forks source link

Control ncspot playback via CLI parameters or an alternative out of process way #617

Closed lawrence-laz closed 3 years ago

lawrence-laz commented 3 years ago

I'm building a voice-controlled personal assistant and would like to use ncspot to play spotify on command.

I would like to be able to start ncspot with some additional parameters, so that the music would start right away, ex. ncspot --playlist MyPlaylist, or similar.

I looked into ncspot -h for available parameters, but didn't see anything that could help with this. Maybe there are other ways to invoke commands on an already running instance of ncspot from another process?

Bettehem commented 3 years ago

You could use something like playerctl to control ncspot via MPRIS

lawrence-laz commented 3 years ago

Yup, this works, thank you! For anyone interested in similar functionality this is how to do it with playerctl:

playerctl --player=ncspot open https://open.spotify.com/user/l.lazauskas/playlist/6K8iu84BUlf4ejOGmvDVmS

You can get URL by sharing song/artist/etc.