For a long time I’ve been wanting to apply ideas found in this interview to decide what to work on at the beginning of a day. The core idea is that even when pruning through scheduling and tags, my org-agenda view still contains too many tasks, and regularly going back to it during the day is overwhelming. So as in the interview above, at the beginning of the day I decide on a few tasks that I want to do today, and a few others that I may do today. These get stored in the org-roam-daily note for today, and I only look at them during the day.
Concretely, my daily note looks like this:
#+title: 2020-11-22 (Sunday)
* [0/2] Do Today
- [ ] [[file:~/Documents/Org/todo-orgx.org::*Relever compteurs][Relever compteurs]]
- [ ] [[file:~/Documents/Org/todo-orgx.org::*Faire les comptes][Faire les comptes]]
* [0/1] Maybe Do Today
- [ ] [[file:~/Documents/Org/todo-orgx.org::*write an org-roam-discourse post about daily task management][write an org-roam-discourse post about daily task management]]
* Journal
** 9:58 Ran for an hour
This post is how I generate it.
There are two technical issues I first need to address: one cannot capture tasks directly from the agenda, and the %a
annotation is not supported by org-roam-dailies-capture-templates
(bug report about the later). Here is the code I use to go from the agenda view to the corresponding task, to run org-capture
, and to store the result in some variable as/agenda-captured-link link
. (Big thanks to the org-mode mailing list that helped me with this.)
(defun as/org-roam-today-mk-agenda-link ()
(interactive)
(let* ((marker (or (org-get-at-bol 'org-marker)
(org-agenda-error)))
(buffer (marker-buffer marker))
(pos (marker-position marker)))
(with-current-buffer buffer
(save-excursion
(goto-char pos)
(let ((link (org-store-link nil)))
(when (stringp link)
(remove-text-properties 0 (length link)
'(read-only t) link))
(setq as/agenda-captured-link link))
(org-roam-dailies-capture-today)))))
The last step calls org-roam-dailies-capture-today
, which uses the variable to write the link. Here is my template definition:
(setq org-roam-dailies-capture-templates
'(("j" "journal" entry
#'org-roam-capture--get-point
"* %<%H:%M> %?"
:file-name "daily/%<%Y-%m-%d>"
:head "#+title: %<%Y-%m-%d (%A)>\n* [/] Do Today\n* [/] Maybe Do Today\n* Journal\n"
:olp ("Journal"))
("t" "do today" item
#'org-roam-capture--get-point
"[ ] %(princ as/agenda-captured-link)"
:file-name "daily/%<%Y-%m-%d>"
:head "#+title: %<%Y-%m-%d (%A)>\n* [/] Do Today\n* [/] Maybe Do Today\n* Journal\n"
:olp ("Do Today")
:immediate-finish t)
("m" "maybe do today" item
#'org-roam-capture--get-point
"[ ] %(princ as/agenda-captured-link)"
:file-name "daily/%<%Y-%m-%d>"
:head "#+title: %<%Y-%m-%d (%A)>\n* [/] Do Today\n* [/] Maybe Do Today\n* Journal\n"
:olp ("Maybe Do Today")
:immediate-finish t)))
(I know recent versions of org-roam
do not need the full :head
as it’s created on demand when there is an olp
property, but I want to create them with the [/]
marker to count tasks.)
This is about it. I’ve bound as/org-roam-today-mk-agenda-link
to a convenient shortcut (SPC m l
), and I can now easily choose tasks from my agenda, dispatching them (using t
or m
) as tasks that must or may be done, respectively.