comfortable.
* Calculating [[MPD playlist duration]].
+* Stopping MPD after *N* songs with [[mpc-stop-after-n-songs.sh]].
* Group-writable playlists with [[ACL]].
* [[Replay gain]].
--- /dev/null
+#!/bin/bash
+
+LAST_SONG=$(mpc current)
+REMAINING="${1:-1}"
+
+echo "${REMAINING} ${LAST_SONG}"
+while [ "${REMAINING}" -gt 0 ]; do
+ SONG=$(mpc current --wait)
+ if [ "${SONG}" != "${LAST_SONG}" ]; then
+ let "REMAINING -= 1"
+ LAST_SONG="${SONG}"
+ echo "${REMAINING} ${LAST_SONG}"
+ fi
+done
+
+mpc stop