Last active
May 17, 2020 05:14
-
-
Save jonasmalacofilho/e2cdb50f74ab20d6dad35925725ba8cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "The uber customizable crossfit timer" | |
TIMERS=( | |
10 "wait" | |
90 "right thruster" 90 "left thruster" 60 "rest" | |
50 "squat rotation" 10 "rest" 50 "plank rotation" 10 "rest" | |
50 "squat rotation" 10 "rest" 50 "plank rotation" 10 "rest" | |
50 "squat rotation" 10 "rest" 50 "plank rotation" 10 "rest" | |
50 "squat rotation" 10 "rest" 50 "plank rotation" 70 "rest" | |
90 "right thruster" 90 "left thruster" | |
) | |
while (( ${#TIMERS[@]} )) | |
do | |
t=${TIMERS[0]} | |
m=${TIMERS[1]} | |
echo "$m ($t s)" | |
espeak "$m $t seconds" 2>/dev/null & | |
for p in $(seq "$t" -1 1); do | |
echo "... $p" | |
if [ "$p" -le 3 ]; then | |
espeak "$p" 2>/dev/null & | |
fi | |
sleep 1 | |
done | |
TIMERS=( "${TIMERS[@]:2}" ) | |
done | |
espeak "Hurray! You are done! Congratulations!" 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment