From 7a186b7af111a36083a8db90f1753a205473d35a Mon Sep 17 00:00:00 2001 From: dummy Date: Thu, 20 Jan 2022 12:21:20 -0500 Subject: [PATCH] update countdown timer to keep remaining time on one line --- bash_scripts/countdown_timer.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bash_scripts/countdown_timer.sh b/bash_scripts/countdown_timer.sh index d6690d5..726164e 100755 --- a/bash_scripts/countdown_timer.sh +++ b/bash_scripts/countdown_timer.sh @@ -5,12 +5,13 @@ PLAYER=mpv FILE="/usr/share/sounds/freedesktop/stereo/message.oga" seconds=${1:-180} +clear echo "Counting down from $seconds" Msg=${2} let "i = $seconds" while [ $i -gt 0 ]; do - echo $i + echo -ne "\r$i " let i-- sleep 1 done