GIT.Harvie.CZ
/
mirrors
/
Programs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
890439a
)
Modified sleepmon to control screen backlight when parameter -s passed
author
Tomas Mudrunka
<tomas@mudrunka.cz>
Wed, 1 Aug 2012 02:31:27 +0000
(
04:31
+0200)
committer
Tomas Mudrunka
<tomas@mudrunka.cz>
Wed, 1 Aug 2012 02:31:27 +0000
(
04:31
+0200)
c/goertzel/sleepmon.sh
patch
|
blob
|
blame
|
history
diff --git
a/c/goertzel/sleepmon.sh
b/c/goertzel/sleepmon.sh
index 3e3ee6ba9af7f0b68812c96a9cf0f4df1f4a46d4..75eb6ee7f63290fbc7ec76c372aada83d57c14d5 100755
(executable)
--- a/
c/goertzel/sleepmon.sh
+++ b/
c/goertzel/sleepmon.sh
@@
-12,10
+12,15
@@
# Wake up
# Enjoy your data
# Wake up
# Enjoy your data
+
out=/tmp/sleeplog-"$(date +%F_%r)".txt
speaker-test -t sine &>/dev/null &
tresh=10
lastdate=0
out=/tmp/sleeplog-"$(date +%F_%r)".txt
speaker-test -t sine &>/dev/null &
tresh=10
lastdate=0
+screen=false
+while getopts "s" OPT; do
+ test "$OPT" == 's' && screen=true;
+done
arecord | ./goertzel -i -q -a -t $tresh -s 2000 | while read line; do
date="$(date +%s)"
time="$(echo "$line" | cut -f 1)"
arecord | ./goertzel -i -q -a -t $tresh -s 2000 | while read line; do
date="$(date +%s)"
time="$(echo "$line" | cut -f 1)"
@@
-23,8
+28,10
@@
arecord | ./goertzel -i -q -a -t $tresh -s 2000 | while read line; do
echo -ne "$time\t$date\t$(date '+%F%t%r')\t"
test "$level" -gt "$tresh" && {
echo -n "Nothing detected...";
echo -ne "$time\t$date\t$(date '+%F%t%r')\t"
test "$level" -gt "$tresh" && {
echo -n "Nothing detected...";
+ $screen && xset dpms force off
} || {
echo -n "Motion detected!!!!";
} || {
echo -n "Motion detected!!!!";
+ $screen && xset dpms force on
}
test "$lastdate" != 0 && {
after=$(( $date - $lastdate))
}
test "$lastdate" != 0 && {
after=$(( $date - $lastdate))
This page took
0.110091 seconds
and
4
git commands to generate.