First of all, change PLAYER to your player of choice, in my case mplayer and create the directory '.playlist' in your home directory. I'll assume you called this script 'music', but you can call it whatever you like.

You can then create your playlists by adding tracks e.g.

Code:

music -a somerandomplaylist music/Artist/Album/01_Somesong.mp3

NOTE: You can only enter relative paths, not full ones. i.e. music/track.mp3 will work, but /home/user/music/track.mp3 won't.

Play your playlist with:

Code:

music -p somerandomplaylist

Stop with:

Code:

music -s

...And resume with:

Code:

music -c

You can then add tracks while it's playing with the '-n' and '-a' arguments in another window.

The '-l' and '-r' arguments should be quite self-explanatory.

UPDATE: You can now skip tracks with the '-b' and '-f' arguments in another window.

Hi,
thanks for your script. Don't know why but somehow the script didn't work on my laptop... so I hacked together my own one based on your solution. It's almost the same without monitor support but with a function creating a play list! Hope this is okay for you, here is the code:

###
# take the first parameter as an entry to the directory with the files

for i in "$2"/*; do
if [ -f "$i" ]
then
echo "`pwd`/$i" >> "$PLDIR/$1"
fi
done
}

function PlayPlaylist {

###
# some words about this code:
# it plays the tracks one by one and is finished if either
# 1) the playlist is finished or
# 2) someone has triggered a $0 -s ("stop signal") from outside (indicated by the $FILE_STOP file)

###
# count number of tracks of current playlist

NUM_TRACKS=`$PROG_CAT $PLDIR/$PL | wc -l | cut -d ' ' -f 1`

###
# go through all tracks one by one
# keep in mind that order of tracks played can be re-arranged using "signals" from outside
# (e.g. -s, -b, -n, -B, -N)

CURRENT_TRACK_NO=0
while [ "$CURRENT_TRACK_NO" -le "$NUM_TRACKS" ]
do

###
# get current track number and current playlist from current_track-file