summaryrefslogtreecommitdiffstats
path: root/bin/dynmpd
blob: 0509cf2491af577d8b5856d2fffdcc962da981f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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