]> git.donarmstrong.com Git - bin.git/commitdiff
update alarm
authorDon Armstrong <don@donarmstrong.com>
Mon, 9 May 2016 19:59:37 +0000 (12:59 -0700)
committerDon Armstrong <don@donarmstrong.com>
Mon, 9 May 2016 19:59:37 +0000 (12:59 -0700)
alarm

diff --git a/alarm b/alarm
index 30648c3a0bb2b8d9bff0dcaa742482dcd7e775a6..ee200a0ddc44e4a0d31949f49d9354e11507e7b0 100755 (executable)
--- a/alarm
+++ b/alarm
@@ -1,8 +1,10 @@
-#!/bin/sh
+#!/bin/bash
+set -x
 SLEEP=$1;
 if [ -z "$SLEEP" ]; then
-    SLEEP="1s";
+    SLEEP="0.1s";
 fi;
+MPG321DEVICE="-o pulse"
 MUSIC=''
 MPG321OPTS="-n 300"
 for plantasia in ~/media/{audio,music}/mort_garson/plantasia/01_plantasia.mp3 \
@@ -13,7 +15,7 @@ for plantasia in ~/media/{audio,music}/mort_garson/plantasia/01_plantasia.mp3 \
         MPG321OPTS="-k 15 -n 224";
     fi;
 done;
-if [ -n "$MUSIC" ]; then
+if [ -z "$MUSIC" ]; then
     if [ -d ~/media/music ]; then
            MUSIC="$(find ~/media/music/ \( -type f -o -xtype f \) -iname '*.mp3' -print -quit)"
     fi;
@@ -21,4 +23,4 @@ if [ -n "$MUSIC" ]; then
            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 ) &