Music Player Daemon Community Wiki


522pages on
this wiki
Add New Page
Talk0 Share
  • 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.
  • Homepage:
  • Maintainer(s): Unknown
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 
while true 
	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 »` 
	sleep $polltime 
	if [ "$song" != "$previous" ]; then 
		if [ -n "$song" ]; then 
			echo $(date +%H:%M:%S) $delimiter "$song" >> $OF 

Ad blocker interference detected!

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.