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
Fix of dates in sleepmon
[mirrors/Programs.git]
/
c
/
goertzel
/
sleepmon.sh
diff --git
a/c/goertzel/sleepmon.sh
b/c/goertzel/sleepmon.sh
index 75eb6ee7f63290fbc7ec76c372aada83d57c14d5..a5d9d8168c790f33924d26ed3d88869b0e9d1299 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
@@
-21,17
+21,18
@@
screen=false
while getopts "s" OPT; do
test "$OPT" == 's' && screen=true;
done
while getopts "s" OPT; do
test "$OPT" == 's' && screen=true;
done
-arecord | ./goertzel -i -q -a -t $tresh -s 2000 | while read line; do
+echo "Writing to file: $out";
+arecord | ./goertzel -n -q -l -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...";
test "$level" -gt "$tresh" && {
echo -n "Nothing detected...";
- $screen && xset dpms force off
+ $screen && xset dpms force off
|| true;
} || {
echo -n "Motion detected!!!!";
} || {
echo -n "Motion detected!!!!";
- $screen && xset dpms force on
+ $screen && xset dpms force on
;
}
test "$lastdate" != 0 && {
after=$(( $date - $lastdate))
}
test "$lastdate" != 0 && {
after=$(( $date - $lastdate))
This page took
0.133581 seconds
and
4
git commands to generate.