diff --git a/scripts/bin/countdown b/scripts/bin/countdown new file mode 100755 index 0000000..aa88762 --- /dev/null +++ b/scripts/bin/countdown @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +d=$((`date +%s` + $1)); +echo "Countdown started $(date)" + +while [ "$d" -ge $(date +%s) ]; do + _dt=$(($d - `date +%s`)) + days=$((_dt / 86400)) + echo -ne "\r${days}d $(date -u --date @$((_dt)) +%H:%M:%S) "; + sleep 0.1 +done + +echo -ne "\rCountdown finished $(date)\n" diff --git a/scripts/bin/sw b/scripts/bin/sw new file mode 100755 index 0000000..58f1713 --- /dev/null +++ b/scripts/bin/sw @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +d="$(date +%s)" +echo "Stopwatch started $(date)" + +while true; do + _dt=$((`date +%s` - d)) + days=$((_dt / 86400)) + echo -ne "\r${days}d $(date -u --date @$((_dt)) +%H:%M:%S) " + sleep 0.1 +done