From 059734fa2ed0fdc198dfd9f3cc88361d43066e23 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 28 Oct 2015 21:24:18 +0100 Subject: add timer function; Usage: timer timer waits for a given amount of minutes. After that it plays an alarm for 20s every minute. --- config/fish/functions/timer.fish | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 config/fish/functions/timer.fish (limited to 'config/fish/functions') diff --git a/config/fish/functions/timer.fish b/config/fish/functions/timer.fish new file mode 100644 index 0000000..7d8bb0e --- /dev/null +++ b/config/fish/functions/timer.fish @@ -0,0 +1,17 @@ +function timer + if test (count $argv) -ne 1 + echo "Usage: timer " + return + end + for i in (seq 1 $argv[1]) + sleep 1m + echo (string replace -r '^0$' ready! (math $argv[1] - $i))m left + end + while true + for i in (seq 1 20) + xkbbell + sleep 1 + end + sleep 1m + end +end -- cgit v1.2.3