1. 23

I wanted to share this with fellow Lobsters, just in case anyone has a New Year’s resolution to keep a journal :)

I’ve kept paper journals, digital journals in evernote and wordpress, etc. I’ve learned not to trust digital journals because the formats change, or I lose the data in “the cloud” somewhere. The only digital journal I trust nowadays is my own collection of text files, stored in a git repo on my own server.

In any case, the point of this very small CLI program is to show just how simple a journal can be. Personally I use this weekly for diary-like entries and saving links or thoughts while I’m working, and I keep a a few paper journals around for less-structured notes, mobile notes (I’ve never found a good note-taking app for phones), or random sketching.

edit: Another great thing for notetaking: Ryan Holiday’s notecard system, which ends up resembling a relational database when taken to the extreme (see the Robert Greene blockquote in that link).

  1.  

  2. 9
    #!/bin/sh
    [ -d "${JOURNAL_DIR:=~/journal}" ] || mkdir -p "${JOURNAL_DIR}"
    while getopts "d:" opt; do
        case "$opt" in
        d) DAY=$OPTARG ;;
        *) printf "usage: ${0##*/} [-d dd.mm.yyyy] [ls|read|write]\n"; exit 1 ;;
        esac
    done
    shift $((OPTIND-1))
    : ${DAY:=$(date +%d.%m.%Y)}
    case "${1:-write}" in
    ls) ls -1 "${JOURNAL_DIR}" ;;
    read) ${PAGER:-more} "${JOURNAL_DIR}/${DAY}" ;;
    write) ${EDITOR:-vi} "${JOURNAL_DIR}/${DAY}" ;;
    *) false ;;
    esac
    
    1. 2

      For some reason this script creates a directory named ~; doing $HOME instead of ~ makes it work as expected for me (using dash as my /bin/sh)

      [ -d "${JOURNAL_DIR:=$HOME/journal}" ] || mkdir -p "${JOURNAL_DIR}"
      
    2. [Comment removed by author]

      1. 3

        I agree on the topic of using paper, which I’ve a renowned love for. We are sometimes so blinded by the screen of our computer that we don’t see our problem (e.g. taking notes) already having been solved in such a simple, robust way (e.g. writing in a physical notebook).

        Also, I hope you were joking about writing passwords down.

        1. 2

          I’m a fan of the basic hardbound sketchbook, for example something like this.

        2. 3

          For me the best part of a journal is re-reading old entries that are relevant to my current life events. It can be humbling to see my old thoughts related to a current topic.

          1. 3

            I’ve taken notes similar to this for a long time, and I mostly keep mine in a great, big text file, with 1 per year. Main things I like about it:

            • Easy to see in one place exactly what you did yesterday, or last week.
            • Get a question from someone about what you did on day X? Just scroll there or open that file, and it’s there. Beats sifting through emails and source control.
            • Need to revisit something that you did a while ago, and you don’t remember when? Just search for keywords or issue numbers or something, and find when you did it and what you did.
            • Helps keep me on track to write down the things I’m doing over the course of a day, and look back on it as needed.
            • Stick to basic text to avoid the temptation to spend too much time fiddling with formatting, pictures, etc.

            I had been using text files stored locally, but had always wanted something a bit more cloud-y, as long as there isn’t too much overhead or needing to sync a year’s worth of notes for every save. So I built my own on my last break: https://www.masongup.com/DailyNotes/. Still pretty bare-bones, but it does what I need it to do - notes stored by the day, searchable and accessible by date, accessible from anywhere.

            1. 2

              Great idea and thanks for sharing, I’ve tried writing a blog in the past and have deleted it more than a few times due to it not being interesting enough. Might have more luck with this given the amount of time I spend in a terminal!

              1. 2

                Thanks for sharing! I love tiny cli tools.

                I’ll ask the same question I always ask: since this seems a wrapper over ls and pager, which is your workflow and how does it benefit from having another tool that you have to manage, instead of the wrapped tools?

                This is not meant as a criticism. I’m just wondering why you felt the need to write a new tool so I’d love to know how you use it and its benefits.

                1. 6

                  I made this mostly to improve the API around accessing my journal text files. So instead of ls ~/journal I just do jour read, and instead of vim ~/journal/2017.01.02 I just do jour and the date is automatically created, file opened in $EDITOR etc. I also plan to add some stats stuff, like how often I journal, how many lines and words per entry, and create a jour stats command to print all that out. At one point I had a cron script that would remind me if I hadn’t journaled yet that day, but it didn’t actually help me remember to journal daily, so I scrapped it.

                  To clarify: the point of this isn’t to be a generally useful tool for everyone. Rather, it’s just to show that something like this is super simple, and you shouldn’t look for a fancy tool to help you keep a journal. Just use the simplest thing that gets the job done. This script could also be a shell script or a few vim/emacs commands, but jour works for me so I shared it :)