In 2023, Cristián posted in X:

During 2022, I noticed that many people were contributing to communities in different ways, but most of them were not aware of the amount of time they spent doing it…including myself. So I started to log everything I was doing on a daily basis

which inspired me to start tracking as well for 2024. His records are also preserved in GitHub if you can’t access the X thread.

To increase my odds of actually tracking anything, I wanted to do it in Obsidian instead of a spreadsheet or some other 3rd party service away from my notes.

I ended up with a format like this, with a new note for each year:

January

2024-01-02

  • 1 h Turku <3 Frontend
    • Send new year emails
    • Update the website for spring
  • 1 h archipylago
    • Did something cool
    • and exciting for an hour

Here, I have a heading level 2 for the year, heading level 3 for each month and a bullet list with [N] h [community] where [N] is how much time I spent and [community] is the name for the community. Under that bullet point, I listed a summary of how I spent the time.

To get the total amount, I wrote a shell script:

cat /path/to/my/note.md \
| grep -Eo "^\t- (\d+\.?(\d+)?)" \
| tr -d '\t-' \
| awk '{s+=$1} END {print "Total hours: " s}'

Running this will output the total hours I’ve spent so far in the given year.

Locales and decimal points

In different locales, different symbols are used for decimal points. If you’re using a locale that uses comma , instead of dot ., you need to adjust the grep pattern by replacing the . with the correct character.

Alternatively, if your shell uses comma-locale and you want your notes to use a dot-locale, you can tell awk to use that with:

LC_NUMERIC="C" awk '{s+=$1} END {print "Total hours: " s}'

This will tell the awk to read decimal numbers with . as the decimal separator instead of ,.

I had lost ~25 hours from my 2024 contribution calculations because I didn’t spot this bug in time.

The script explained

  • cat [file] will output this entire file
  • grep -Eo [pattern] will find the hour markings (-E for regex, -o for printing match only instead of entire line)
  • tr -d '\t- will delete the leading tab and dash
  • awk '{s+=$1} END {print s}' will sum each number, giving the final sum of the year

In 2024, I managed to be quite focused with my tracking until the summer when we took a break from community organising and I forgot to get back on it for the second half of the year. I’m trying to do better in 2025.

I’ve decided to keep my actual notes private to protect the privacy of others involved.