From: Don Armstrong Date: Fri, 26 Feb 2016 20:28:02 +0000 (-0800) Subject: have alarm search more places for music X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d28e7b1f5990e8f4e08b8f0798590e85d632f11e;p=bin.git have alarm search more places for music --- diff --git a/alarm b/alarm index 320bc6c..30648c3 100755 --- a/alarm +++ b/alarm @@ -5,15 +5,20 @@ if [ -z "$SLEEP" ]; then fi; MUSIC='' MPG321OPTS="-n 300" -if [ -e ~/media/audio/mort_garson/plantasia/01_plantasia.mp3 ]; then - MUSIC='/home/don/media/audio/mort_garson/plantasia/01_plantasia.mp3' - MPG321OPTS="-k 15 -n 224"; -elif [ -e ~/media/jack2/Plantasia/01\ Plantasia.mp3 ]; then - MUSIC='/home/don/media/jack2/Plantasia/01 Plantasia.mp3' - MPG321OPTS="-k 15 -n 224"; -else +for plantasia in ~/media/{audio,music}/mort_garson/plantasia/01_plantasia.mp3 \ + ~/media/jack2/Plantasia/01\ Plantasia.mp3; do + + if [ -e "${plantasia}" ]; then + MUSIC="${plantasia}" + MPG321OPTS="-k 15 -n 224"; + fi; +done; +if [ -n "$MUSIC" ]; then + if [ -d ~/media/music ]; then + MUSIC="$(find ~/media/music/ \( -type f -o -xtype f \) -iname '*.mp3' -print -quit)" + fi; if [ -d ~/media/jack ]; then - MUSIC="$(find ~/media/jack/ -type f -iname '*.mp3' -print -quit)" + MUSIC="$(find ~/media/jack/ \( -type f -o -xtype f \) -iname '*.mp3' -print -quit)" fi; fi; (sleep $SLEEP; mpg321 $MPG321OPTS "$MUSIC" >/dev/null 2>&1 ) &