Distraction-free writing with a terminal timer and Ubuntu notifications

post
developer productivity
software tool
Neat, you can create a timer in your terminal window!
Author

Gregory M. Kapfhammer

Published

2018

Have you ever struggled to focus on your technical writing? Even though I enjoy writing research papers, I too can sometimes find it difficult to focus on technical writing. So, what should you do when you mind is wandering and you have to finish some content by a deadline? Of course, set a timer!

Since I prepare papers and presentations using Neovim in a terminal window running tmux, I recently looked for a timer that I could also run at the command prompt. Thankfully, I discovered this post about termdown!

If you check the documentation for termdown, you will notice that it is a Python program that you install by typing the following command in your terminal window: pip install termdown. This program has a lot of options that you can learn more about by reading its documentation. For my purposes, I wanted the countdown timer to run for 30 minutes and then to trigger an Ubuntu notification when it expired.

Is it possible to achieve this goal with a single command in your terminal!

termdown 30m -T "Distraction-Free Writing" --no-figlet && notify-send "Distraction-Free Writing" \ "Task Finished\!"

The first parameter specifies the number of minutes for which I will be writing and the second gives a title to the countdown display. Using the --no-figlet parameter ensures that termdown shows a minimal countdown timer. Finally, when the timer completes, the call to notify-send will trigger an Ubuntu notification with “Distraction-Free Writing” as the title and “Task Finished!” as the message. This should also work with other Linux operating systems.

Get the Gist!
Further Details

Do you have any questions about this technique? Or, do you have some tips for distraction-free writing? If you do, then I hope that you will contact me soon!

Return to Blog Post Listing