Skip to content

Instantly share code, notes, and snippets.



Last active Jun 26, 2020
What would you like to do?
A Pomodoro timer for the macOS terminal

Blog 2020/6/23

<- previous | index | next ->

A Pomodoro timer for the macOS terminal

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!".


# A Pomodoro timer for the macOS terminal.

set -e

if test -z "$1"
    echo "Usage: $( basename $0 ) <duration in minutes>" >&2
    exit 1


echo "Starting a Pomodoro timer of $minutes minutes."

while test $i -lt $minutes
    sleep 60
    i=$(( $i + 1))
    echo $i minutes elapsed

echo "Hey Pomodoro, time's up!"
say "hey pomodoro, times up"

Console output:

$ 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!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.