Blog 2020/6/23
<- previous | index | next ->
Here is a simple Pomodoro timer for the Mac command line.
When time is up, your Mac speaks the phrase "Hey Pomodoro, time's up!".
pomo.sh
:
#!/bin/bash
# A Pomodoro timer for the macOS terminal.
set -e
if test -z "$1"
then
echo "Usage: $( basename $0 ) <duration in minutes>" >&2
exit 1
fi
minutes=$1
echo "Starting a Pomodoro timer of $minutes minutes."
i=0
while test $i -lt $minutes
do
sleep 60
i=$(( $i + 1))
echo $i minutes elapsed
done
echo "Hey Pomodoro, time's up!"
say "hey pomodoro, times up"
Console output:
$ pomo.sh 45
Starting a Pomodoro timer of 45 minutes.
1 minutes elapsed
2 minutes elapsed
3 minutes elapsed
...
43 minutes elapsed
44 minutes elapsed
45 minutes elapsed
Hey Pomodoro, time's up!
thanks! love your way to use say in terminal