GIT.Harvie.CZ
/
mirrors
/
Programs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improved histogram framesize
[mirrors/Programs.git]
/
c
/
goertzel
/
sleepmon.sh
diff --git
a/c/goertzel/sleepmon.sh
b/c/goertzel/sleepmon.sh
index 42bbcad33f37a50fb2c249bd50b67b69835d7fc3..4896e87327002696a3092d70f5ea4c3351ddf36e 100755
(executable)
--- a/
c/goertzel/sleepmon.sh
+++ b/
c/goertzel/sleepmon.sh
@@
-13,7
+13,7
@@
# Enjoy your data
# Enjoy your data
-out=/tmp/sleeplog-"$(date +%F_%
r
)".txt
+out=/tmp/sleeplog-"$(date +%F_%
T
)".txt
speaker-test -t sine &>/dev/null &
tresh=10
lastdate=0
speaker-test -t sine &>/dev/null &
tresh=10
lastdate=0
@@
-22,11
+22,11
@@
while getopts "s" OPT; do
test "$OPT" == 's' && screen=true;
done
echo "Writing to file: $out";
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)"
date="$(date +%s)"
time="$(echo "$line" | cut -f 1)"
level="$(echo "$line" | cut -f 2)"
- echo -ne "$time\t$date\t$(date '+%F%t%
r
')\t"
+ echo -ne "$time\t$date\t$(date '+%F%t%
T
')\t"
test "$level" -gt "$tresh" && {
echo -n "Nothing detected...";
$screen && xset dpms force off || true;
test "$level" -gt "$tresh" && {
echo -n "Nothing detected...";
$screen && xset dpms force off || true;
@@
-42,4
+42,5
@@
arecord | ./goertzel -n -q -l -t $tresh -d 4 | while read line; do
lastdate="$date";
done | tee "$out"
kill $!
lastdate="$date";
done | tee "$out"
kill $!
+echo
echo "Your file: $out"
echo "Your file: $out"
This page took
0.138494 seconds
and
4
git commands to generate.