2019-11-30 12:00

Automating a daily journal with Joplin

image

I have a long-standing interest in personal knowledge management (PKM). I’ve tried lots and lots of different tools, and I recently learned about Joplin and decided to try it out.

Requirements, or “Is that too much to ask?”

There’s not a lot of specific things I want out of a PKM tool, but I’ve had a hard time getting them all together in a single product. My must-haves are:

  • Absolutely minimal time-to-capture, so as not to interrupt flow

  • Some sort of hierarchical organization, so I have a place to stash notes that aren’t currently pertinent but are worth keeping around for future reference

  • Some sort of search functionality (I’m not above running grep -r on a directory of text files)

  • Some sort of backup or sync mechanism (similarly, */5 * * * * git commit -a && git push would suffice)

  • Some mechanism for tracking a daily journal so I know what I accomplished over the last day/week/month; this was a habit I picked up from PlannerMode, which should give you an idea of how long I’ve been shaving this particular yak

Joplin manages most of these:

  • I used Automator to make a global keyboard shortcut to get quick access to write a new note

  • Notebooks and sub-notebooks are arbitrarily nestable, QED

  • Search works fine, and the cmd-G “Goto anything” feature is handy (if incomplete since you cannot “go” to notebooks)

  • Dropbox sync, that works

However, Joplin does not have a daily journal built-in. Since this was the only major shortcoming, I decided to hack something together.

tl;dr show me the code

Joplin does have an API, but reading through the docs for it was painful so I decided to just run the command-line version too and automate it. I created a script named journal.sh that I can run at any time to create a new template-based file with today’s date in the appropriate notebook, and then I can go fill it out with the day’s work.

$ cat ~/bin/journal.sh
#!/bin/bash

TMPDIR=`mktemp -d`
TMPFILE=$TMPDIR/$(date +"%Y-%m-%d")

cat >$TMPFILE <

Comments