X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=alarm;h=61c61197d0a0489a670ff1b9e77d290b9c8f0dfb;hb=1886c7247cb16ed68a78cd5550b152689a465999;hp=06520684751d2a50bcd18914d09ce6c4225eb80f;hpb=ed316b24ea498e22c4bb46ce21198393763b10c6;p=bin.git diff --git a/alarm b/alarm index 0652068..61c6119 100755 --- a/alarm +++ b/alarm @@ -1,16 +1,25 @@ -#!/bin/sh +#!/bin/bash SLEEP=$1; if [ -z "$SLEEP" ]; then - SLEEP="15m"; + SLEEP="0.1s"; fi; +MPG321DEVICE="-o pulse" MUSIC='' MPG321OPTS="-n 300" -if [ -e ~/media/jack/Plantasia/01\ Plantasia.mp3 ]; then - MUSIC='/home/don/media/jack/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 [ -z "$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 -exit)" + MUSIC="$(find ~/media/jack/ \( -type f -o -xtype f \) -iname '*.mp3' -print -quit)" fi; fi; -(sleep $SLEEP; mpg321 $MPG321OPTS "$MUSIC" >/dev/null 2>&1 ) & +(sleep $SLEEP; mpg321 $MPG321DEVICE $MPG321OPTS "$MUSIC" >/dev/null 2>&1 ) &