diff options
| author | Thomas Voss <mail@thomasvoss.com> | 2025-11-05 20:31:00 +0100 |
|---|---|---|
| committer | Thomas Voss <mail@thomasvoss.com> | 2025-11-05 20:31:00 +0100 |
| commit | 7c8ec4add2b8dd9a361973e4cfee362d1961c1eb (patch) | |
| tree | 11bfee5841eb6b7021a1c51f3d1ac1a85e7c4442 /.local/bin | |
| parent | de249ba6ade51856e85623124c18a3b0fb0b1d38 (diff) | |
alarm: Add the alarm script
Diffstat (limited to '.local/bin')
| -rwxr-xr-x | .local/bin/alarm | 22 |
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 |