From: Tomas Mudrunka Date: Mon, 30 Jul 2012 00:24:24 +0000 (+0200) Subject: First version of sleep monitor X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=d66438402d9f5240612f5fe411c12371d81d367e;p=mirrors%2FPrograms.git First version of sleep monitor --- diff --git a/bash/sleepmonitor/sleepmon.sh b/bash/sleepmonitor/sleepmon.sh new file mode 100755 index 0000000..8674e95 --- /dev/null +++ b/bash/sleepmonitor/sleepmon.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Simple sleep monitor (Harvie 2012) +# +# You probably have soundcard with one output and input +# Take PIR motion sensor from security system +# Use PIR to switch connection between left channels of output and input (tips of 3.5mm jacks) +# Connect grounds of these two together (maybe you will not need it - depending on your soundcard) +# Power up PIR +# Launch this script +# Use alsamixer and some GUI recorder (like audacity) to tune volume to some usable level +# Place PIR facing to your bed and go sleep +# Wake up +# Enjoy your data + +out=/tmp/sleepmon-"$(date +%F_%r)".wav +speaker-test -t sine &>/dev/null & +time arecord -r 4000 "$out" +kill $! +echo "Your file: $out"