Just a quicky for today.. I could have sworn that there was a oneliner
on commandlinefu.com (which is a great page
btw!) to add a random album to MPD (Music Player
Daemon), but I
wasn't able to find it. So time to quickly build one on my own..
These are the few lines to put in your .bashrc, so you can then just
type 'mpd_randomadd' or 'mpd_randomreplace' and you'll get a
new-random album added. The tracks will stay in order, don't worry.
[code lang="bash"]
MUSICDIR="/home/user/music"
MPDHOST="linuxbox"
alias mpd_randomadd='mpc -h \$MPDHOST add "\$(cd \$MUSICDIR; find
-follow -mindepth 1 -type d | shuf | head -n1 | cut -b3- ; cd
->/dev/null)"'
alias mpd_randomreplace='mpc -h \$MPDHOST clear ; mpc -h \$MPDHOST add
"\$(cd \$MUSICDIR ; find -follow -mindepth 1 -type d | shuf | head -n1 |
cut -b3- ; cd ->/dev/null)"; mpc -h \$MPDHOST play'
[/code]
Ask if you have questions ;-)
Cheers,
Raphi