Small shellhack that will move songs around on your playlist. This was written in a few minutes and I'm not a bash guru, so bear with me.
I release this in an almost-PD license: copy it, edit it, change it, but please give credit, that's pretty much all I ask.
#!/bin/bash # mpcshuf.sh: "Shuffles" the mpd playlist. # By Renan Birck, '09. # Last updated: 02/04/09. UPPER=`mpc | sed '2q;d' | cut -f 2 -d ' ' | cut -f 2 -d '/'` # How many times max. to shuffle? for X in `seq 0 $UPPER`; do MAXSONG=$UPPER; RANFROM=$RANDOM; RANTO=$RANDOM; let "RANFROM = $RANFROM % $MAXSONG + 1"; let "RANTO = $RANTO % $MAXSONG + 1"; mpc move $RANFROM $RANTO; echo "Moved song " $RANFROM " to " $RANTO; # For debugging, remove if you want. done
- renan.dream AT gmail.com