03-05-2019, 04:57 PM
(02-26-2019, 03:25 PM)tristanc Wrote: What do you think?
This oneliner add 3 random songs from library to current playlist and play the first one.
Code:
mpc listall | shuf -n3 | mpc -q add && mpc play $(expr $(mpc playlist | wc -l) - 2)
You can create function (or script):
Code:
function rta() {
if [ -z "$1" ]; then
n="1"
else
n="$1"
fi
mpc listall | shuf -n "$n" | mpc -q add
(( n-- ))
mpc play $(expr $(mpc playlist | wc -l) - "$n" )
}
"rta n" adds n random tracks and play the first one.