-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.qmd
57 lines (45 loc) · 2.44 KB
/
index.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
author: Gregory M. Kapfhammer
title: Distraction-free writing with a terminal timer and Ubuntu notifications
date: '2018-01-01'
date-format: YYYY
categories: [post, developer productivity, software tool]
description: <em>Neat, you can create a timer in your terminal window!</em>
aliases: ["/writing/productivity/idea/2017/07/21/Distraction-Free-Writing/"]
---
Have you ever struggled to focus on your technical writing? Even though I enjoy
writing [research](/research/) papers, I too can sometimes find
it difficult to focus on technical writing. <span class="gist"> 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!</span>
Since I prepare [papers](/research/papers/) and
[presentations](/research/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](http://www.slashgeek.net/2016/10/25/termdown-cli-countdown-timer-stopwatch/)
about [termdown](https://github.com/trehn/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.
<span class="gist">Is it possible to achieve this goal with a single command in
your terminal!</span>
```
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.
{{< include /_gist.qmd >}}
::: {.callout-note appearance="simple"}
## 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](/contact/) me soon!
:::
{{< include /_back-blog.qmd >}}