Listen for mpd events.
To run the daemon, execute the following command where script points to a script that will be run on new events.
$ mpdnotify <script>
$ make $ sudo make install
Below is an example of a script that can be run. For more information, see the man page.
#!/bin/sh song="$(mpc --format '%title%' | head -1)" if [ "$MPD_STATE_NAME" = "MPD_STATE_PLAY" ]; then notify-send "Playing" "$song" fi
mpdnotify requires libmpdclient installed.