aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/timer
blob: 886c310f6ed6f2fcf0f7905f6a8bb5b1d0f398a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env sh

NAME="$1"
shift
TIME="$@"

[ -z "$TIME" ] && { TIME="$NAME"; NAME="Timer"; }

if $(sleep "$TIME"); then
    notify-send -a timer "$NAME" "Elapsed: $TIME\nTimer Ended: $(date +%T)"
else
    notify-send -a timer "Error" "Bad time string: $TIME"
fi