Closed teddywaweru closed 7 months ago
Well, you can just filter by the event it is triggered for. So for example in a bash script, you can do:
#!/bin/bash
[ "$PLAYER_EVENT" = "play" ] || exit 0
# rest of script
It's actually what I required. Thanks. Still curious on whether it would be feasible to have the filter within spotifyd itself so that it isn't always triggering for each player_event, and users can specify which events they want to hook to in their spotifyd configs.
I think that this would make configuration unnecessarily complicated, when all the functionality is already there. Maybe adding documentation to this option would make it easier to use? Something like #1271?
Yeah, that's a better solution than overhauling the config. Also, my limited know-how on exported variables made me unable to figure this out initially. Thank you.
I had anticipated that the on_song_change_hook would be triggered for the PLAYER_EVENT "play", but I have had scenarios where it's triggered for the "preload", "preloading", "endoftrack" and "change" events as well. I'd wanted to use the hook to notify the next song specifically, but it seems to be triggered by multiple events.