From efaeb390d847eeffde05a80c97c05eef0c9535b0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 19 Mar 2009 09:13:55 +0100 Subject: countdown: Fancier display of remaining time --- etc/functions/countdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'etc') diff --git a/etc/functions/countdown b/etc/functions/countdown index 3c8bba9..28639f4 100755 --- a/etc/functions/countdown +++ b/etc/functions/countdown @@ -1,7 +1,8 @@ ## vim:ft=zsh ## Countdown to a specific date/time ## Usage: countdown -## Copyright (C) 2008 by Daniel Friesel +## or: countdown + +## Copyright (C) 2008-2009 by Daniel Friesel ## License: WTFPL autoload check_com @@ -21,7 +22,7 @@ if [[ $1 == +* ]] { while true; do seconds=$[$(date -d $date +%s)-$(date +%s)] - echo -n $seconds + printf '%02d:%02d:%02d' $((seconds/3600)) $(((seconds/60)%60)) $((seconds%60)) if (( seconds <= 0 )) { (( beep )) && beep || echo -ne "\a" } -- cgit v1.2.3