Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers
Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.
Description: Small bash script to log tracks played with MPD to a plain text file. It is very simple and customizable being under 20 lines of code. It depends on mpc. This has been supplanted in the author's case by using ncmcpp and the on song change ability. It's still useful for ideas, I suppose, or if you use mpc and not ncmpcpp.
path="$HOME" #path to write out files
delimiter="â•‘" #used to seperate time and track info - other suggestions: â€£ âœ â¯ â™¥
polltime=1 #how often to poll in seconds
OF=Playlist-$(date +%Y%m%d) #filename format, placed here so it changes when date changes
song=`mpc --format "%artist% #Â» %album% #Â» %track% #Â» %title% #Â» %time%" |grep Â»`
if [ "$song" != "$previous" ]; then
if [ -n "$song" ]; then
echo $(date +%H:%M:%S) $delimiter "$song" >> $OF