From f140a1642ebfde198946ad6760c1003c1cb9a8c3 Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Sat, 11 Aug 2012 02:40:34 +0200 Subject: scripts --- bin/dynmpd | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 bin/dynmpd (limited to 'bin/dynmpd') diff --git a/bin/dynmpd b/bin/dynmpd new file mode 100755 index 0000000..0509cf2 --- /dev/null +++ b/bin/dynmpd @@ -0,0 +1,22 @@ +#!/bin/bash +TIMEOUT=5 +CONSUME=`mpc | tail -1 | awk '{print $(NF-0)}'` +mpc load "$1" && mpc play + +if [[ $CONSUME == "off" ]]; then + mpc consume && echo "Activating Consume Mode"; +else + echo "Consume Mode already active" +fi + +while(true); do +ITEMS=`mpc playlist | wc -l` +if [ $ITEMS -le "0" ] ; then + mpc load "$1" + echo "adding new songs from lastfm" + mpc play; +else + echo "nothing to do" +fi +sleep $TIMEOUT +done -- cgit v1.2.3-24-g4f1b