Creating Promodoro for Mac CLI

by
, posted

In this post we will explore the Pomodoro Technique and introduce a Pomodoro Timer specifically designed for Mac Command Line Interface (CLI). But before getting our hands dirty with the actual work let me first brief you on where does this Promodoro word even come from. The term has to do with a technique known as “Promodoro Technique”.

What is Promodoro Technique

The Pomodoro Technique is a time management method developed by Francesco Cirillo in the late 1980s. It uses a kitchen timer to break work into intervals, typically 25 minutes in length, separated by short breaks. Each interval is known as a pomodoro, from the Italian word for tomato, after the tomato-shaped kitchen timer Cirillo used as a university student.

The original technique has six steps:

This technique, developed by Francesco Cirillo, has gained popularity among individuals seeking an efficient and structured approach to work. Personally I also find Promodoro Technique very useful when I need to concentrate on certain learning or course material for longer durations.

The technique is so popular that you will find the Promodoro Timer both in app and web version for any operating system (OS). I personally have been using a native app on my machine for few months now Tomato 2. Other web based worthy mentions are promofocus.io & tomatotimers.com.

Creating Promodoro for CLI

Now let’s dive into the actual job.

Install timer using your corresponding package manager. For e.g on Mac run

brew install caarlos0/tap/timer

Next, launch your shell config file. If you are using default bash shell, hit vim ~/.bashrc to edit the config file. I’m using zsh as my default shell therefore vim ~/.zshrc works for me. Paste the following snippet in your config file:

work () {
        duration=$1
        timer "$duration" && say 'Time to take a break buddy! Getup and go for a walk! Drink some water!'
}
rest () {
        duration=$1
        timer "$duration" && say 'Well done! Now lets do some work!'
}

Hit Esc, & type :wq to exit. Now either restart your terminal or source your config file by firing

$ source ~/.bashrc # In case of bash shell
OR
$ source ~/.zshrc # In case of zsh shell

Okay we are done with setup, now let’s get working, shall we!

Working

Say you want to start your promodoro of 25 minutes, fire up your terminal & type

$ work 25m  # For 25 minutes
$ work 10 # For 10 seconds
$ work 1h # For 1 hour

It will start your Promodoro timer. Once the interval finishes it will terminate & you will be notified via sound reading out the message we passed on previously “Time to take a break buddy! Getup and go for a walk! Drink some water!” via speaker.

Note: Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”. If no unit is passed, it defaults to seconds (“s”).

Next you will want to take a rest of say 5 minutes enter the following command:

$ rest 5m

Once the rest duration finishes it will read out “Well done! Now lets do some work!” via speaker.

Conclusion

By leveraging the Pomodoro Technique and a dedicated Pomodoro Timer for Mac CLI, individuals can improve their productivity, espcially those who tend to live inside terminal most of the time. It can be applied for Linux machines too with certain tweaks duh. If you want to share any thoughts on this CLI Promodoro timer feel free to reach out.

Reply via mail

Your Signature