diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2015-10-28 21:24:18 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2015-11-27 02:32:49 +0100 |
| commit | 059734fa2ed0fdc198dfd9f3cc88361d43066e23 (patch) | |
| tree | 6cd3d4e8207b274c8cc88328158841d3897797ac | |
| parent | a5422311d183e59fa469c0595fbacab12b6ebd86 (diff) | |
| download | dotfiles-059734fa2ed0fdc198dfd9f3cc88361d43066e23.tar.gz dotfiles-059734fa2ed0fdc198dfd9f3cc88361d43066e23.zip | |
add timer function;
Usage: timer <minutes>
timer waits for a given amount of minutes.
After that it plays an alarm for 20s every minute.
| -rw-r--r-- | config/fish/functions/timer.fish | 17 |
1 files changed, 17 insertions, 0 deletions
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 <minutes to wait>" + 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 |
