tonly show notification at work - exercise_time - announce workout exercises wi… | |
git clone git://src.adamsgaard.dk/exercise_time | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit d9dec5e55a66bdca0409e01d2fad52172535a7dd | |
parent bfb50faf6928ef38e7160c4e3ee0cdf4e0738517 | |
Author: Anders Damsgaard <[email protected]> | |
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(-) | |
--- | |
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 offi… | |
# 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 exerci… | |
+ | |
+ # 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 exerci… | |
if [[ $IP ]]; then | |
say "$announcement" | |
fi |