summaryrefslogtreecommitdiffstats
path: root/Kübelwagen
diff options
context:
space:
mode:
Diffstat (limited to 'Kübelwagen')
-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