isamert.net
About Feeds

How do I keep my days organized with org-mode and Emacs


Preamble

I've been using org-mode to organize my life for quite a long time; all the deadlines, recurring events, any kind of plans, projects etc. lives in several org files. Most beneficial part of this approach is that, things grow. When you write something down and have an easy way to access that piece, you'll start expanding it. You also start to notice patterns which eventually leads you to do some optimization with that particular thing. Also there some other minor benefits like not forgetting important stuff and seeing your life in a more structured manner. These are all great but you need to find a balance between planning/note-taking and doing actual stuff, otherwise it'll just overwhelm you and impact everything negatively. I'm not saying that I figured it out all but at least for this particular piece, organizing your day in an org file, I have some nice ideas.

General structure

I have a file called bullet.org where I keep all these day management stuff1. The name comes from bullet journaling thing and I'm not sure if this can be called as bullet journaling but the name gives a little bit more personality to the file and I like that.

Starting the day

Every new day, I create a new level 1 header with today's date and start planning the day. I have a snippet, called daily, that expands to a big checklist of my daily routines2. So far I got this:

bullet_routines.png

I use clocking functionality to keep track of how much time I spent on doing stuff. So I just start clocking on the Daily planning TODO item. I'll show how I utilize this later in the post.

The screenshot does not reflect all the things I had in my daily snippet but it's rough estimate. As you can see, I left little clues for myself in the Daily Planning header and all the other headers have some predefined directions for me. For instance, Breakfast header reminds me to take my daily supplements (so that when I do my breakfast and open bullet.org to mark it as done I just remember my pills), Housework has some predefined works that I need to do, like washing dishes etc, Reading has a link to my reading list (which is just another org file) and to my current readings so that I can recap what I was working on. Little conveniences like that. I just remove what's not related to this day while I'm going through the headers, like today's a weekend and I do not need to worry about work stuff so I just remove those check boxes.

One minor anecdote about these notes: Since I added the Plan the dinner part to Daily planning header I started cooking at home even more regularly. Before that, I was thinking about the dinner once I get hungry and because of multiple reasons (like being hungry at that moment, not having enough ingredient to do something) I would just go ahead and order something. Cooking is pretty disciplined activity and planning makes it easy.

As my habits/routines change, this daily snippet also changes. Important thing is you should be able to do this relatively easily. I have some shortcuts to quickly access my snippets and edit them. Just to note, I use yasnippet for the snippets.

The reason for having all of these routines under a header called Routines instead of expanding them right under the current days header is to keep my daily view clean and uncluttered. See next screenshot.

So when I finish planning, I just clock out:

bullet_2.png

And this is what the whole day looks like after planning:

bullet_4.png

Right now, it's weekend and there is nothing related to work here. When there is work items, I just tag them with work tag, so that I can do just hide/show work-related and non-work-related pretty easily. Other than this case, I don't use tags much. Here is an example working day:

bullet_work.png

I tend to schedule things to specific hours, so that I can see them on my agenda view and when I sync this files to my phone orgzly sends me notifications before the scheduled time. I don't really use orgzly anything other than this, except using it's pretty widget on my main screen so that when I pull up my phone, the first thing I see is my TODO items.

Little conveniences

There some little things that I sprinkled through my Emacs configuration that makes this file a bit more accessible and pretty.

org-bullets

Pretty famous package that brings some fanciness to org documents.

(use-package org-bullets
  :ensure t
  :hook (org-mode . org-bullets-mode))

org-fancy-priorities

This brings some fanciness to priority indicators.

(use-package org-fancy-priorities
  :diminish
  :ensure t
  :hook (org-mode . org-fancy-priorities-mode)
  :config
  (setq org-fancy-priorities-list '("🅰" "🅱" "🅲" "🅳" "🅴")))

org-pretty-tags

Well, I don't make use of tags much but here you go, it replaces your tags with nice little UTF8 icons of your choice.

(use-package org-pretty-tags
  :diminish org-pretty-tags-mode
  :ensure t
  :config
  (setq org-pretty-tags-surrogate-strings
        '(("work"  . "⚒")))

  (org-pretty-tags-global-mode))

Fancy checkboxes

This does not need any external dependency, it's possible to do it with prettify-symbols-mode:

(isamert/prettify-mode 'org-mode-hook
                       '(("[ ]" . "☐")
                         ("[X]" . "☑" )
                         ("[-]" . "❍" )))

;; Also here is `isamert/prettify-mode' macro.
;; You don't need this but it's a bit more convinient if you make use of
;; prettify-symbols minor mode a lot
(defmacro isamert/prettify-mode (mode pairs)
  "Prettify given PAIRS in given MODE. Just a simple wrapper around `prettify-symbols-mode`"
  `(add-hook ,mode (lambda ()
                     (mapc (lambda (pair)
                             (push pair prettify-symbols-alist))
                           ,pairs)
                     (prettify-symbols-mode))))

Quickly accessing the file

It's quite important to be able to easily open and take notes into this file. Thus, I created a shortcut that toggles this file on right side of Emacs. See the following:

bullet_toggling.png

The code is a bit long but the important function is isamert/toggle-side-bullet-org-buffer. I assigned a keybinding to this and it simply toggles the file in a side buffer.

(defun isamert/toggle-side-bullet-org-buffer ()
  "Toggle `bullet.org` in a side buffer for quick note taking.  The buffer is opened in side window so it can't be accidentaly removed."
  (interactive)
  (isamert/toggle-side-buffer-with-file "~/Documents/notes/bullet.org"))

(defun isamert/buffer-visible-p (buffer)
 "Check if given BUFFER is visible or not.  BUFFER is a string representing the buffer name."
  (or (eq buffer (window-buffer (selected-window))) (get-buffer-window buffer)))

(defun isamert/display-buffer-in-side-window (buffer)
  "Just like `display-buffer-in-side-window' but only takes a BUFFER and rest of the parameters are for my taste."
  (select-window
   (display-buffer-in-side-window
    buffer
    (list (cons 'side 'right)
          (cons 'slot 0)
          (cons 'window-width 84)
          (cons 'window-parameters (list (cons 'no-delete-other-windows t)
                                         (cons 'no-other-window nil)))))))

(defun isamert/remove-window-with-buffer (the-buffer-name)
  "Remove window containing given THE-BUFFER-NAME."
  (mapc (lambda (window)
          (when (string-equal (buffer-name (window-buffer window)) the-buffer-name)
            (delete-window window)))
        (window-list (selected-frame))))

(defun isamert/toggle-side-buffer-with-file (file-path)
  "Toggle FILE-PATH in a side buffer. The buffer is opened in side window so it can't be accidentaly removed."
  (interactive)
  (let ((fname (file-name-nondirectory file-path)))
  (if (isamert/buffer-visible-p fname)
      (isamert/remove-window-with-buffer fname)
    (isamert/display-buffer-in-side-window
     (save-window-excursion
       (find-file file-path)
       (current-buffer))))))

Throughout the day

Throughout the day, I just clock the work I'm doing. For work days, I take small notes about the thing I'm working on that moment. If that thing seems to be going to take more than 1-2 days I'll just create a header for that thing in my projects.org and take my notes there, bullet.org is only responsible for clocking and having a link to that header in projects.org for these kind of specific stuff. I also take my meeting notes here in bullet.org.

As you may have realized, there is another header called Notes in the screenshots above. This is for taking out of context notes during the day, like:

  • A clever/useful code snippet
  • A realization of something
  • A link to look at later
  • Anything else that I want to be interested later on

Having this header there and seeing it time to time also forces you to come up with some pretty useful notes for yourself. Sometimes I just see it and think: yeah, that was quite nice, I should take a note. I try to utilize org-mode features as much as I can while doing this. I create links to code files, put screenshots etc. And while we are there, here is a snippet that I use for quickly capturing screenshots into org documents:

  (defun isamert/org-attach-image-from-clipboard (file-path)
    "Save the image from clipboard to FILE-PATH and attach it into the document.
If FILE-PATH is empty or nil, then image is created under ~/.cache with a random name.
FILE-PATH is relative to the current documents directory."
    (interactive "sSave file to (leave empty to create a temp file): ")
    (let ((file (if (and file-path (not (string-empty-p file-path)))
                    file-path
                  (make-temp-file "~/.cache/org_temp_image_" nil ".png"))))
      (cond
       ((locate-file "xclip" exec-path) (shell-command (format "xclip -selection clipboard -target image/png -out > %s" file)))
       ((locate-file "pngpaste" exec-path) (shell-command (format "pngpaste %s" file)))
       (t (message "Either install xclip (for linux) or pngpaste (for mac) to get this functionality.")))
      (insert (format "#+ATTR_ORG: :width 400\n[[file:%s]]" file))
      (org-display-inline-images)))

Finishing the day

If you've seen in the above screenshots, there was another header called Summary. When the day ends, that is to say, before going to bed I open bullet.org and create a Summary header. First thing I do is to get an overall view of what I've been doing the whole day. I do this by creating a clocktable with the following settings:

#+BEGIN: clocktable :scope tree1 :maxlevel 3 :block untilnow
:scope tree1
This takes the scope as the surrounding level 1 header, which corresponds to today's header.
:maxlevel 3
Just to make things simple.
:block untilnow
Instead of using :block day, I use this. Because a day does not end when clock hits to 00:00 (technically yes, the day ends but for my perception the day ends when I go to sleep). So :block untilnow incorporates all the clockings under this days header (day as in my perception) and we are limited with the :scope tree1 so no other clockings from other days gets mixed up in our table. See:
bullet_summary_clocktable.png

After this, if I'm feeling well I just add a few observations about the day or maybe note down unexpected things that I encountered during the day. I also open my Notes header and try to create tasks based on those and simply move easy ones to where they belong (like moving snippets to my snippet file etc.).

Conclusion

Well, that's it. I have other org files that I use along with bullet.org and I utilize org-ql to connect things together or to find/filter them instead of relying on agenda but I guess that's an another post. I've been using this exact methodology more than one year (earlier I had similar methods but they were quite different in terms of organization etc.) and I can say that it's somewhat effective against my procrastination. I'm not saying that I don't need willpower anymore but it's easier to do things when you're more organized and this file keeps me sane during the day.

Appendix

Footnotes:

1

All of my daily notes are in this file, I don't like creating a new file for each day for various reasons. Moving tasks between them becomes problematic, jumping to an earlier day is problematic and if I want to, I can always do org-narrow-to-subtree and that's it, it's like an individual file now.

2

The reason for not using a static header for these kind of habits/routines with a recurring timestamp is that it does not give you enough flexibility. Sometimes I skip breakfast and sometimes I do it in a very different time than usual. This way I have full control over the day with some starting points. I also like to see the all of my daily items under the same header instead of resorting to the agenda.

Similar posts