hrkfdn / ncspot

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

Trigger a command on song state change? #251

Closed Barbaross93 closed 4 years ago

Barbaross93 commented 4 years ago

Hello,

I'm new to ncspot so I apologize if this is something that's already implemented. I was wondering if its possible to trigger a command when ever the current song changes? I.e., when it pauses, plays, starts the next song, stops, etc. Spotifyd has an onevent config that will execute a command whenever the song changes. Normally this is useful for custom notifications (but I see that I can configure that myself), but in this case, I want to be able to extract album art using the tool playerctl and then show it in a tmux pane with ueberzug.

Barbaross93 commented 4 years ago

I ended up figuring out a workaround: playerctl has a --follow flag that will update whenever the specified meta data changes