Snotify is a simple notification tool for Spotifyd written in Python 3.
Dependencies: dunst (or similar)
git clone https://github.com/teegre/snotify.git
To be able to use snotify, you need to get your own client id and client secret.
Go to: https://developer.spotify.com/dashboard/ and connect.
Then click on "create a client id" and follow the instructions.
When you're done:
At the top of the snotifier script:
SPOTIFY_CLIENT_ID="YOUR_CLIENT_ID"
SPOTIFY_CLIENT_SECRET="YOUR_CLIENT_SECRET"
export SPOTIFY_CLIENT_ID
export SPOTIFY_CLIENT_SECRET
replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET by your own credentials.
If you use a password manager like pass you can of course pass the command to the
variables. For instance:
SPOTIFY_CLIENT_ID="$(pass path/to/spotify_client_id)"
...
python setup.py install --user
Then make sure to change snotifier permissions:
chmod 700 "$HOME"/.local/bin/snotifier
Add this line to your Spotifyd config file (~/.config/spotifyd/spotifyd.conf):
onevent = /home/username/.local/bin/snotifier
Note:
~/.config/snotify directory is created when you first use snotify.
It contains a cache directory that stores album images, and also a token file.
Finally restart Spotifyd:
systemctl --user restart spotifyd.service
That's it. A notification should display on song start / change / stop.
By default, Snotify displays "artist: track title".
That said, if you want to change notification format, you have to modify the snotifier script to your likings:
You can specify what to display by using the -f (--format) option. For instance :
snotify -f '%artist: %title'
or
snotify -i -f $'%title\n%artist\n%album | %year'
Possible variables are:
Variable | Description |
---|---|
%artist | artist name |
%title | track title |
%album | album |
%year | year of release |
onevent = /home/username/bin/snotifier
-h --help
-f --format=FORMAT text format
-i --image - display album art in notification
-F --force - force output to stdout
-v --version
Use the script included:
./uninstall.sh
Remove the onevent line in your spotifyd.conf file and restart Spotifyd.