tonly show notification at work - exercise_time - announce workout exercises with notifications and speech synth
 (HTM) git clone git://src.adamsgaard.dk/exercise_time
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit d9dec5e55a66bdca0409e01d2fad52172535a7dd
 (DIR) parent bfb50faf6928ef38e7160c4e3ee0cdf4e0738517
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Tue, 26 May 2015 22:14:23 +0200
       
       only show notification at work
       
       Diffstat:
         M exercise_time.sh                    |      11 ++++++++---
       
       1 file changed, 8 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/exercise_time.sh b/exercise_time.sh
       t@@ -51,17 +51,22 @@ for ((i=0; i<$1; i++)); do
            # Send message to notification daemon if computer is plugged in at my office
            # desk
            if [[ $IP ]]; then
       -        if command -v notify-send &>/dev/null; then
       +
       +        # OS X
       +        if [[ "$UNAMESTR" == 'Darwin' ]]; then
       +            osascript -e "display notification \"$2\" with title \"It's exercise time\""
       +
       +        # Linux
       +        elif [[ "$UNAMESTR" == 'Linux' ]]; then
                    notify-send "$announcement"
                fi
            fi
        
            # Use speech synthesis if the computer is plugged in at my office desk
       -
            if [ $SPEECHSYNTH -eq 1 ]; then
       +
                # OS X
                if [[ "$UNAMESTR" == 'Darwin' ]]; then
       -            osascript -e "display notification \"$2\" with title \"It's exercise time\""
                    if [[ $IP ]]; then
                        say "$announcement"
                    fi