Sleepmon gnuplot graphing
[mirrors/Programs.git] / c / goertzel / sleepmon.sh
index a5d9d8168c790f33924d26ed3d88869b0e9d1299..87967dd9d86148714cc6776541ff5a7033c1e670 100755 (executable)
@@ -22,16 +22,16 @@ while getopts "s" OPT; do
        test "$OPT" == 's' && screen=true;
 done
 echo "Writing to file: $out";
-arecord | ./goertzel -n -q -l -t $tresh -d 4 | while read line; do
+arecord | ./goertzel -n i -q -l c -t $tresh -d 4 | while read line; do
        date="$(date +%s)"
        time="$(echo "$line" | cut -f 1)"
        level="$(echo "$line" | cut -f 2)"
        echo -ne "$time\t$date\t$(date '+%F%t%T')\t"
        test "$level" -gt "$tresh" && {
-               echo -n "Nothing detected...";
+               echo -n "Nothing detected...";
                $screen && xset dpms force off || true;
        } || {
-               echo -n "Motion detected!!!!";
+               echo -n "Motion detected!!!!";
                $screen && xset dpms force on;
        }
        test "$lastdate" != 0 && {
@@ -39,7 +39,9 @@ arecord | ./goertzel -n -q -l -t $tresh -d 4 | while read line; do
                echo -ne "\t$level After $after secs";
        }
        echo;
+       ./sleepplot.sh "$out" &>/dev/null;
        lastdate="$date";
 done | tee "$out"
 kill $!
+echo
 echo "Your file: $out"
This page took 0.124302 seconds and 4 git commands to generate.