summaryrefslogtreecommitdiff
path: root/dot/local/bin/alarming
diff options
context:
space:
mode:
Diffstat (limited to 'dot/local/bin/alarming')
-rwxr-xr-xdot/local/bin/alarming31
1 files changed, 31 insertions, 0 deletions
diff --git a/dot/local/bin/alarming b/dot/local/bin/alarming
new file mode 100755
index 0000000..a5561a9
--- /dev/null
+++ b/dot/local/bin/alarming
@@ -0,0 +1,31 @@
1#!/bin/sh
2ALARM_SENTINEL_FILE=$HOME/.alarming
3main()
4{
5 if [ $# = 0 ]
6 then
7 alarm_on 3 'alarming' &
8 elif [ "$1" = off ]
9 then
10 alarm_off
11 else
12 usage
13 fi
14}
15
16alarm_off()
17{
18 rm -f "$ALARM_SENTINEL_FILE"
19}
20
21alarm_on()
22{
23 touch "$ALARM_SENTINEL_FILE"
24 while [ -e "$ALARM_SENTINEL_FILE" ]
25 do
26 dracos-alarm "$@"
27 sleep 1
28 done
29}
30
31main "$@"