Function - play # uses mplayer random directories

I have this in my .bashrc and use it to play my music. It is organized by directories and this will play them in random order:

play(){ ## play directories with mplayer (random)
if [ $# -eq 0 ]
then
    # if no option show music types
    echo -n "
play {directory|style}

Styles:
-------"
    find  ~/music/ -maxdepth 1 -type d -print | cut -d'/' -f5|sort
else
    # create tmp list
    xtitle "mplayer tunes!"
    clear
    [ ! -e $1 ] && cd ~/music
    find -L $1 -type f -name \*.\* >play.$$
    if [ "$1" == "vids" ]
    then
        \mplayer -fs -msgcolor -shuffle -playlist play.$$ 2>/dev/null
    else
        \mplayer -msgcolor -shuffle -playlist play.$$ 2>/dev/null
    fi

    \rm play.* 2>/dev/null
    cd -
fi
}

I have many other tools and such, if folks find them of use I will post them.

bd - Put your hand on a hot stove for a minute and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. That's Relativity. - A.E.