tfirst commit - exercise_time - announce workout exercises with notifications a… | |
git clone git://src.adamsgaard.dk/exercise_time | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit d12925842b23e422df3e7e9f4fef4d2aeb18f89a | |
parent f6820d2bcdbd2500bc3c03c29039bd7d35cecb30 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 30 Sep 2014 14:15:59 +0200 | |
first commit | |
Diffstat: | |
A exercise_time.sh | 27 +++++++++++++++++++++++++++ | |
1 file changed, 27 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/exercise_time.sh b/exercise_time.sh | |
t@@ -0,0 +1,27 @@ | |
+#!/bin/bash | |
+ | |
+# IT'S EXERCISE TIME! | |
+# Requires the `festival` speech synthesizer. | |
+ | |
+# Wait time in seconds between sets | |
+WAITSECS=120 | |
+ | |
+function usage { | |
+ echo "Usage: $1 <SETS> <EXERCISE>" | |
+ echo "Example: For three sets of ten pushups, use:" | |
+ echo " $0 3 'Do ten push ups'" | |
+} | |
+ | |
+if [ "$1" == "-h" ]; then | |
+ usage | |
+ exit | |
+fi | |
+ | |
+# stop mpd if it is running | |
+mpc stop &> /dev/null | |
+ | |
+# announce exercise the specified number of times | |
+for ((i=0; i<$1; i++)); do | |
+ echo "It's exercise time! $2" | festival --tts | |
+ sleep $WAITSECS | |
+done |