diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-08-12 11:22:11 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-08-12 11:22:11 +0200 |
commit | 1941fa46a9808f61b16ec445bb4fcccb4e29e527 (patch) | |
tree | 96d5081a0e9071e5688395b4c4e9012b7ab05e7d /etc | |
parent | c6c88434bdacf39e9b3dfa3678d66704d58bc296 (diff) |
removed countdown function
Diffstat (limited to 'etc')
-rw-r--r-- | etc/functions/countdown | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/etc/functions/countdown b/etc/functions/countdown deleted file mode 100644 index 28639f4..0000000 --- a/etc/functions/countdown +++ /dev/null @@ -1,31 +0,0 @@ -## vim:ft=zsh -## Countdown to a specific date/time -## Usage: countdown <string understood by 'date -d'> -## or: countdown +<seconds> -## Copyright (C) 2008-2009 by Daniel Friesel <derf@derf.homelinux.org> -## License: WTFPL <http://sam.zoy.org/wtfpl> - -autoload check_com -typeset -i beep=0 -typeset -i seconds -typeset date - -if check_com beep; then - beep=1 -fi - -if [[ $1 == +* ]] { - date=@$(($(date +%s) + ${1#+})) -} else { - date="$*" -} - -while true; do - seconds=$[$(date -d $date +%s)-$(date +%s)] - printf '%02d:%02d:%02d' $((seconds/3600)) $(((seconds/60)%60)) $((seconds%60)) - if (( seconds <= 0 )) { - (( beep )) && beep || echo -ne "\a" - } - sleep 1 - echo -ne "\r\e[2K" -done |