#!/usr/bin/env bash # this script generates *.m3u playlists of Ogg Vorbis files. # Matthew Graybosch / 3 August 2003 / uses BSD license MUSIC="/music" PLAYLIST="/home/matthew/playlist" HOME="/home/matthew" cd $PLAYLIST rm * # generate the playlists cd $MUSIC for genre in * do cd "$MUSIC/$genre" for band in * do echo "$band" cd "$MUSIC/$genre/$band" for album in * do cd "$MUSIC/$genre/$band/$album/" for song in * do echo "$MUSIC/$genre/$band/$album/$song" >> "$PLAYLIST/$band.m3u" done cd "$MUSIC/$genre/$band" done cd "$MUSIC/$genre" done cd $MUSIC done # now let's generate a menu file I can # paste into the rc3 file Openbox3 uses # to store configuration. # but nuke the old file first! rm $HOME/ob3-playlist.xml cd /music for genre in * do cd "$genre" echo "
" >> $HOME/ob3-playlist.xml cd .. done cd ~ exit 0