A collection of useful MPD scripts, written in bashism-free POSIX shell.
media-control wraps Playerctl and mpc. If MPD is running, this "translates" Playerctl commands (
next) to mpc commands; otherwise, it forwards commands to Playerctl. This is useful for binding XF86Audio* keys to prioritize MPD over other MPRIS players.
When forwarding commands to Playerctl, it adds
$GI_TYPELIB_PATH if Playerctl has been installed with prefix
MPD, mpd-mpris, and cantata-dynamic are managed by Systemd. Yes, I know, I know...
mpd-playlist-above-rating takes an integer argument from 0-10, and outputs a playlist containing tracks above the given rating.
mpd-playlist-unrated outputs a list of tracks without a "rating" sticker. This is useful for listening to music in your library you haven't heard yet.
mpd-playlist-smart generates a playlist skewed towards your favorite tracks, intended to be played with shuffle on. The playlist is built according to one rule: the number of times a track appears is equal to its rating minus 5 (or 0, whichever is greater). As a result, tracks must contain a rating of at least 6 to be added. Tracks rated 6/10 appear once, while tracks rated 10/10 appear four times. The higher you rate a track, the more likely it is to be played on shuffle. It requires
rate-track, or the Cantata player to set ratings.
Scripts in the
now-playing directory operate on the current track. They display the currently-playing track with some extra info, get/set the track's rating and other stickers, etc.
mpris/ directory has scripts that work with MPRIS rather than directly through mpd. They combine well with a program such as mpd-mpris to bridge mpd and MPRIS.