summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2025-11-05 20:31:00 +0100
committerThomas Voss <mail@thomasvoss.com> 2025-11-05 20:31:00 +0100
commit7c8ec4add2b8dd9a361973e4cfee362d1961c1eb (patch)
tree11bfee5841eb6b7021a1c51f3d1ac1a85e7c4442 /.local/bin
parentde249ba6ade51856e85623124c18a3b0fb0b1d38 (diff)
alarm: Add the alarm script
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/alarm22
1 files changed, 22 insertions, 0 deletions
diff --git a/.local/bin/alarm b/.local/bin/alarm
new file mode 100755
index 0000000..716ea1b
--- /dev/null
+++ b/.local/bin/alarm
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+set -e
+
+export NOTIFY_LONG=alarm
+export NOTIFY_SHORT="${0##*/}"
+
+readonly PIPE="${XDG_CONFIG_HOME:-$HOME/.config}/eww/data/timer.pipe"
+exec >"$PIPE"
+
+if [ $# -gt 1 ]
+then
+ >&2 printf 'Usage: %s [duration]\n' "${0##*/}"
+ exit 1
+fi
+
+stdbuf -oL -- patience -f '%m:%02S' "${1:-m=1}"
+echo ''
+exec >&-
+
+notify 'Timer Complete' 'The global timer has reached its end'
+aplay -q ~/media/sfx/alarm.wav