Execute on song change
Rmpc provides on_song_change property in the config file which can be used to run a command whenever the song changes. This can be used for various purposes like showing a desktop notification.
Desktop notification on song change
Assuming you have a notification daemon with support for images like dunst running.
All song metadata are available to the script as environment variables. For example $TITLE
, $FILE
, $DURATION
, etc.
-
Create a script and place it somewhere. For example
~/.config/rmpc/notify
. Below is an example of such script. Edit it to your needs or create a new one. -
Make the script executable
-
In your rmpc’s
config.ron
specify on_song_change property and point it at location of the script from step 1. -
Restart rmpc
Track song play count
This allows you to track and display song’s play count in the queue table (or header). Please note that rmpc has to be running for the script to execute and increment the play count.
-
Configure sticker_file in your
mpd.conf
-
Create a script and place it somewhere. For example
~/.config/rmpc/playcount
and make the script executable. Or append it to an existingon_song_change
script. -
Increment playCount sticker on the song inside the script. (requires jq)
-
Change your
config.ron
to execute the script you created on song change -
Change your theme to include play count sticker, for example in the queue table