spotifyd icon indicating copy to clipboard operation
spotifyd copied to clipboard

trying to make duns show notifications

Open graziel666 opened this issue 3 years ago • 2 comments

i'm trying to make duns show notifications, following the steps on the wiki, and with not success at all

i made the scripts, put them inside the config file from spotifyd (btw on the wiki it says .conf, but i think now we using tolm right?) i have my scripts on /home/"user"/bin on the onevent line i set it like onevent = "/home/myUser/bin/notifications.sh" also tried with onevent = "$HOME/bin/notifications.sh"

and never getting success sadly, tried with both ways, the api and playerctl versions, with the playerctl if i remove the "if" condition and test it running a song, i get the info correctly but there's no way to get it to work as intended

graziel666 avatar Feb 04 '22 05:02 graziel666

Thanks for the report!

Sidenote: Spotifyd's config file is indeed named spotifyd.conf (see here), it just uses TOML as its format.

In theory, what you described should work (AFAICT). There are however multiple things that could have gone wrong, which cause that the script is not executed.

It would definitely help, if you could provide the requested information from the template (especially the output of spotifyd --debug --no-daemon). That will show, wether your config file is actually read properly and if there are any errors that prevent your script from running.

Apart from that, you can check wether spotifyd is actually trying to execute the script by looking at the output. It should contain lines like the following:

Running "spotifyd-notification" using "/usr/bin/zsh" with environment variables {"PLAYER_EVENT": "volumeset", "VOLUME": "65535"}
...
"Hello" from the spotifyd-notification script!
Running "spotifyd-notification" using "/usr/bin/zsh" with environment variables {"TRACK_ID": "<track_id>", "PLAYER_EVENT": "start", "POSITION_MS": "3825", "PLAY_REQUEST_ID": "0"}
...
Running "spotifyd-notification" using "/usr/bin/zsh" with environment variables {"TRACK_ID": "<track_id>", "PLAYER_EVENT": "load", "PLAY_REQUEST_ID": "0", "POSITION_MS": "3825"}
...
"Hello" from the spotifyd-notification script!
Running "spotifyd-notification" using "/usr/bin/zsh" with environment variables {"PLAY_REQUEST_ID": "0", "DURATION_MS": "255555", "PLAYER_EVENT": "play", "POSITION_MS": "3824", "TRACK_ID": "<track_id>"}
"Hello" from the spotifyd-notification script!

Maybe this helps you already. If not, the mentioned debug logs will probably help to trace down the issue. :smiley:

eladyn avatar Feb 04 '22 22:02 eladyn

thanks for the answer! weirdly enough after like..... 200 restart (before reading this) and turning off the laptop, it just started working perfectly fine have no idea what changed on it or why it was doing that

graziel666 avatar Feb 06 '22 14:02 graziel666