One liner bash to create/update playlist for mpd

  |   Source

I put all my audio files in ~/Music.

The below script create a playlist in m3u format and ask mpd to load it:

cd ~/Music;find . -name '*.mp3' -o -name '*.flac'|sed -e 's%^./%%g' > all.m3u;mpd ~/.mpd/config;mpc clear;mpc load all.m3u;mpc update

Here is content of my ~/.mpd/config which is basically only a copy from official sample configuration:

# See the mpd.conf man page for a more detailed description of each parameter.
music_directory     "~/Music"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
pid_file "~/.mpd/"
state_file "~/.mpd/mpdstate"
Comments powered by Disqus