summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSt33v <github@f3rr3t.com>2026-02-02 11:10:05 +1100
committerSt33v <github@f3rr3t.com>2026-02-02 11:10:05 +1100
commit8afd703427d86fdb7ef6e3046a4075d99366fac0 (patch)
tree2087377f2bf3ae827792a5d305ab9ae8dc94f570
parenta816f25bd534792ba60cbe9650a5b47a015bcede (diff)
commit very old files
-rwxr-xr-xspeakerSqueaker.sh12
-rwxr-xr-xsuper.sh7
2 files changed, 11 insertions, 8 deletions
diff --git a/speakerSqueaker.sh b/speakerSqueaker.sh
index 6b5dc58..71a7ede 100755
--- a/speakerSqueaker.sh
+++ b/speakerSqueaker.sh
@@ -23,20 +23,20 @@ maxAmp=$(rec -d -c1 -n trim 0 .5 stat 2>&1 | grep 'Maximum amp' | awk {'print $3
# xprintidle is logfile eyecandy. Not necessary for the script to work
echo $(xprintidle) Max Amplitude = "$maxAmp" | \
systemd-cat -t "idle time (msec) & audio level " -p notice
+
+timerMins=10m # default timer duration
if [ "$maxAmp" == "0.000000" ]; then
# We have silence
- if [ -f "/tmp/silencemarker" ] ; then
- timerMins=10m
- else
+ if [ ! -f "/tmp/silencemarker" ] ; then
+ # This is the first instance of silence after detecting noise
touch /tmp/silencemarker
- timerMins=4m
fi
# Play the tone.
# Even though there may have been some sounds played since the previous
# observation, let's play it safe.
- echo 'Play inaudible tone (40 Hz for 1 sec)'
- play -nq synth 1 sine 40 fade 0.2 0
+ echo 'Play inaudible tone (20 Hz for 2 sec)'
+ play -nq synth 2 sine 20 fade 0.4 0
else
# Sound was detected so remove the marker file if it is there
if [ -f "/tmp/silencemarker" ] ; then
diff --git a/super.sh b/super.sh
index 325f86d..36e02c6 100755
--- a/super.sh
+++ b/super.sh
@@ -15,8 +15,11 @@ if [ -z $1 ]
exit 1
fi
-echo $theDate,$1 >> $logFile
-#printf '%s,%s\n' $theDate ,$1 >> $logFile
+if [ $1 != "tail" ]
+ then
+ echo $theDate,$1 >> $logFile
+ #printf '%s,%s\n' $theDate ,$1 >> $logFile
+fi
# Note: double quote expression to preserve carriage returns (thanks, stackoverflow)
echo "$(tail ${logFile})"