Skip to content

Instantly share code, notes, and snippets.

Last active May 27, 2022
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!
Copy link

CHAIYOMIN commented May 27, 2022

thanks! love your way to use say in terminal

Copy link

cellularmitosis commented May 27, 2022


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment