summaryrefslogtreecommitdiffstats
path: root/Kübelwagen
diff options
context:
space:
mode:
Diffstat (limited to 'Kübelwagen')
-rw-r--r--Kübelwagen/Makefile2
-rwxr-xr-xKübelwagen/alarm27
-rw-r--r--Kübelwagen/alarm.sh5
3 files changed, 28 insertions, 6 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
new file mode 100755
index 00000000..a117c433
--- /dev/null
+++ b/Kübelwagen/alarm
@@ -0,0 +1,27 @@
+#! /bin/sh
+#
+# //Kübelwagen/alarm SLEEPARGS...
+#
+# where SLEEPARGS are passed to sleep(3)
+#
+set -euf
+cd $(dirname $(readlink -f $0))
+exec >&2
+
+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
diff --git a/Kübelwagen/alarm.sh b/Kübelwagen/alarm.sh
deleted file mode 100644
index 601a18db..00000000
--- a/Kübelwagen/alarm.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /bin/sh
-echo 'You are made of stupid!' >&2
-exit 23
-
-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