summaryrefslogtreecommitdiff
path: root/.local/bin/alarm
blob: 716ea1b5af6e5124966533ed9bd0991d5b24400c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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