Skip to content

Loading…

Improved support for non MacOS platforms #5

Merged
merged 5 commits into from

2 participants

@kgaughan

This patch adds support for espeak, fixes a misspelling, and is now compatible with GNU which (it doesn't support BSD -s flag). It also ensures the 5-minute warning doesn't distort the timing of the pomodoro.

@kgaughan

I'd better note that this patch will also close issue #1.

@tobym
Owner

Everything else looks good. Thanks!

@tobym tobym merged commit ba6cea4 into tobym:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 8 additions and 4 deletions.
  1. +8 −4 pom
View
12 pom
@@ -32,7 +32,7 @@ function print_status {
if [ $minutes_remaining = 5 ]
then
- safe_say "$minutes_remaining minutes remaining in your pomadoro"
+ safe_say "$minutes_remaining minutes remaining in your pomadoro" &
fi
}
@@ -47,19 +47,23 @@ function finish {
echo $msg >> $logfile
fi
- break_msg="Pomadoro complete. Take a 5 minute break."
+ break_msg="Pomodoro complete. Take a 5 minute break."
echo $break_msg
safe_say "$break_msg" || ring_bell
}
# Audibly say something, if possible.
function safe_say {
- which -s say && say $1
+ for cmd in espeak say
+ do
+ which $cmd >/dev/null && $cmd "$1" 2>/dev/null && return
+ done
+ return 1
}
# Try to ring the terminal bell.
function ring_bell {
- which -s tput && tput bel
+ which tput >/dev/null && tput bel
}
# Print short version of help.
Something went wrong with that request. Please try again.