Pomodoro Technique For Improved Productivity

Recently I was listening to a podcast which advocated the use of pomodoro technique for better focus and improved productivity for the tasks at hand. It essentially talks about having undivided attention and zero distraction for a period of 25 minutes followed by a short 5 mins break. This completes one pomodoro cycle. The catch is it should be completely without distractions. If you were not able to focus completely then pomodoro cycle does not count. After four successful cycles you can take a well deserved long break.

I wanted to put this to test and almost immediately started looking around for a tool which will help me track my pomodoro cycle. There are application that keep track and show pop ups or notifications when a cycle ends. Here are some worthy candidates

  1. Pomidor (Paid app)
  2. Zeegaree lite
  3. Pomodoro Gnome Extension (Wasn’t useful on MATE)
  4. Tomato Timer (web page)

If you think about it, pomodoro timer in essense is just a count down timer set to 25 minutes. There is no real need to have such fancy apps. So I wanted to write some code, some quick script which will help me achieve what the above tools are trying to do.

Sure enough the answer is a simple “sleep” and “notify-send” commands which are already available on the unix shell. “sleep” takes in an argument which indicates the time duration and unit. So something like 25m implies script will sleep for 25 minutes. This followed by a simple “notify-send” invocation would indicate completion of a pomodoro cycle and that its time for a quick break. “notify-send” also takes in different parameters to be able to display better messages in the notification badge.

I went over the top and added some fancy icon and a message on the notification
sleep 25m && notify-send -u critical -t 15000 -i "/usr/share/icons/pomodoro.png" 'Hail Pomodoro Master !!' 'You deserve a break.\nSee you in 5 mins.' &

The pomodoro.png was just a thumbs up icon I wanted to use on the notifcation. It could be anything that fancies your mind. The script was placed in /usr/local/bin with appropriate permissions (755).

Next I wanted to have this as part of the start menu so that it is possible to launch it as an application rather than invoking the script from terminal. This is fairly simple task and just needs some .desktop files to be created which will launch the script.

Here are basic steps I followed to create a menu shortcut for the pomodoro script.

1. Create .desktop file
sudo nano /usr/share/applications/pomodoro.desktop

2. Add the following entry into the file
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=/usr/share/icons/pomodoro.png
Name[en_US]=Start Pomodoro
Exec=/usr/local/bin/pomodoro
Name=Start Pomodoro
Icon=/usr/share/icons/pomodoro.png

3. Change the file permissions so that they can be invoked from the application menu.
sudo chmod 644 /usr/share/applications/pomodoro.desktop
sudo chown root:root /usr/share/applications/pomodoro.desktop

With these quick changes, I had a simple pomodoro timer and notification on my system, ready to use and help me get more focused on the work.

Screenshot showing the application menu
App-menu

Notification pop-up on completion of one cycle.
notify-send

And a handy-dandy pomodoro notifier is ready!