From 1941fa46a9808f61b16ec445bb4fcccb4e29e527 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 12 Aug 2009 11:22:11 +0200 Subject: removed countdown function --- etc/functions/countdown | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 etc/functions/countdown (limited to 'etc/functions/countdown') 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 -## or: countdown + -## Copyright (C) 2008-2009 by Daniel Friesel -## License: 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 -- cgit v1.2.3