summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@iiso>2011-09-12 01:40:08 +0200
committertv <tv@iiso>2011-09-12 01:40:08 +0200
commit68c0644cf950f84edf4ac225172049d6a43fd0d4 (patch)
tree672f75a450a73f06b2e3c24312e2d08d47628ee0
parent32b8f75f145789d87407bb0c4e5d09be992e6666 (diff)
//Kübelwagen/alarm: now more awesome than evar!
-rw-r--r--Kübelwagen/Makefile2
-rwxr-xr-x[-rw-r--r--]Kübelwagen/alarm28
2 files changed, 26 insertions, 4 deletions
diff --git a/Kübelwagen/Makefile b/Kübelwagen/Makefile
index e180d047..9be84e13 100644
--- a/Kübelwagen/Makefile
+++ b/Kübelwagen/Makefile
@@ -1,7 +1,7 @@
CC := gcc -std=c99
CFLAGS := -D_XOPEN_SOURCE=500
-LIBS := $(shell pkg-config --cflags --libs jack)
+LIBS := $(shell pkg-config --cflags --libs jack) -lm
.PHONY: all clean
diff --git a/Kübelwagen/alarm b/Kübelwagen/alarm
index 601a18db..a117c433 100644..100755
--- a/Kübelwagen/alarm
+++ b/Kübelwagen/alarm
@@ -1,5 +1,27 @@
#! /bin/sh
-echo 'You are made of stupid!' >&2
-exit 23
+#
+# //Kübelwagen/alarm SLEEPARGS...
+#
+# where SLEEPARGS are passed to sleep(3)
+#
+set -euf
+cd $(dirname $(readlink -f $0))
+exec >&2
-sleep 5h 19m && while :; do echo $(echo "($(od -tu -An -N 2 /dev/urandom)%1000)+500"|bc) $(echo "($(od -tu -An -N 2 /dev/urandom)%500)+100"|bc) ; done | ./a.out 1
+make
+
+jackd -d alsa &
+trap "kill -0 $! && kill $!" EXIT INT
+
+for i in `seq 8000 1000 10000`; do
+ echo $i 100
+done | ./a.out 1
+echo 'if you heard that sound, then goto sleep..^_^'
+
+echo sleep "$@"
+sleep "$@"
+
+echo 'wake up!'
+while :; do
+ echo $(echo "($(od -tu -An -N 2 /dev/urandom)%1000)+500"|bc) $(echo "($(od -tu -An -N 2 /dev/urandom)%500)+100"|bc)
+done | ./a.out 1