Pomodoro technique with CLI on macOS
I often turn to the Pomodoro Technique when I'm overwhelmed by my to-do list. This method involves working for a set period (X minutes), followed by a short break (Y minutes), promoting focused sessions.
After trying various apps that lacked the simplicity I desired, I discovered a straightforward command line tool.
Prerequisites
🔗Before diving into the specifics, here is what you will need:
- Install timer — a small utility written in Go that has features such as displaying progress using a progress bar, showing remaining time and named timers.
- Make sure that you are using a terminal app (such as iTerm) with alert notifications enabled.
Using timer
🔗The timer command accepts a duration argument with a unit specifier (s
for seconds, m
for minutes, h
for hours, and so on). For example, to set a timer for 30 seconds:
timer 30s
You can also add a description to your timer using the -n
flag:
timer 30s -n "Some task"
Notification using tput bel
🔗tput
is a versatile command that allows shell scripts to perform things such as clear the screen, underline the text, or ring a bell (beep).
You can combine it with timer
to get an alert when your session ends.
timer 30s -n "Short break" && tput bel
If your terminal window is in the background and alerts are enabled, you will receive a notification as shown below:
Conclusion
🔗This setup offers a minimalistic approach to a commonly used technique to manage your focus sessions.
More Posts
Browse all posts
I'm a software developer and a technical writer. On this blog, I write about my learnings in software development and technical writing.
Currently, working maintaining docs at 𝝠 Expo. Read more about me on the About page.