Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


One button / command to load & play random track?
#11
(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.
Reply


Messages In This Thread
RE: One button / command to load & play random track? - by Henio - 03-05-2019, 04:57 PM

Forum Jump: