Simple CLI Pomodoro timer for macOS
• • #productivity
Learn how to use a simple terminal-based Pomodoro timer on Mac. It provides the following features:
- Start work and rest periods easily from your terminal
- Displays a beautiful progress bar
- Displays a Notification when timer is up
It only requires two Open Source packages to use it. Below are some screenshots.
Work timer:
Rest timer:
Notification when timer is up:
Install
#Requires https://github.com/caarlos0/timer and https://github.com/julienXX/terminal-notifier to be installed, e.g. with Homebrew:
brew install caarlos0/tap/timer
brew install terminal-notifier
Then add this to your terminal config, in my case the ~/.zshrc
file:
work() {
# usage: work 10m, work 60s etc. Default is 20m
timer "${1:-20m}" && terminal-notifier -message 'Pomodoro'\
-title 'Work Timer is up! Take a Break 😊'\
-sound Crystal
}
rest() {
# usage: rest 10m, rest 60s etc. Default is 5m
timer "${1:-5m}" && terminal-notifier -message 'Pomodoro'\
-title 'Break is over! Get back to work 😬'\
-sound Crystal
}
Usage
#Now you can use work
and rest
as terminal commands with an optional parameter for the duration (specified with m
for minutes or s
for seconds). work
defaults to 20 minutes, and rest
defaults to 5 minutes.
Examples:
work
work 45m
work 60s
rest
rest 10m
rest 30s
Resources
#I got this idea from this video by bashbunni. This is her original Mac Gist.
It can be adapted to also work on Linux (Gist for Linux).