aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/timer
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/timer')
-rwxr-xr-xscripts/timer13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/timer b/scripts/timer
new file mode 100755
index 0000000..886c310
--- /dev/null
+++ b/scripts/timer
@@ -0,0 +1,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