Fandom

Music Player Daemon Community Wiki

Hack:AMPDlogger

525pages on
this wiki
Add New Page
Talk0 Share

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.

  • 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: MorskNorsk.mine.nu:666/~mordbrann/ampdlogger
  • Maintainer(s): Unknown
#!/bin/bash 
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 
previous=$RANDOM 
while true 
do 
	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 
			previous="$song" 
		fi 
	fi 
done

Also on Fandom

Random Wiki