diff --git a/bin/just-play-something b/bin/just-play-something new file mode 120000 index 0000000..51eff03 --- /dev/null +++ b/bin/just-play-something @@ -0,0 +1 @@ +../multimedia/just-play-something.sh \ No newline at end of file diff --git a/multimedia/README b/multimedia/README index 646d225..5967303 100644 --- a/multimedia/README +++ b/multimedia/README @@ -28,10 +28,14 @@ What this script will do for you: your library and play it; - if music is already playing, it will be paused. -Tip: you can bind a short button press to just-play-something, and a -long press (or another button) to mpc clear && just-play-something, so -that if you don't like what is currently in the playlist, you can force -playing a random album with a long press. +Tips: +- You can bind a short button press to 'just-play-something', and a long + press (or another button) to 'mpc clear ; just-play-something', so + that if you don't like what is currently in the playlist, you can + force playing a random album with a long press. +- Running this script from another host works just fine by setting the + MPD_HOST variable (and possibly MPD_PORT), for example: + MPD_HOST=192.168.0.254 just-play-something # metflac-field2field.sh # diff --git a/multimedia/just-play-something.sh b/multimedia/just-play-something.sh index 7b42d3f..12c28b4 100755 --- a/multimedia/just-play-something.sh +++ b/multimedia/just-play-something.sh @@ -31,7 +31,7 @@ if ! mpc >/dev/null 2>&1 ; then fi # If the playlist is empty, add a random album to the playlist -if [ "$(mpc playlist 2>/devlnull)" = "" ] ; then +if [ "$(mpc playlist 2>/dev/null)" = "" ] ; then NB_ALBUMS=`mpc list Album | wc -l` RAND_ALBUM_NUM=`random $NB_ALBUMS` RANDOM_ALBUM=`mpc list Album | sed -n ${RAND_ALBUM_NUM}p`