mark cerqueira well-rounded nerd

Calendar Colorist!

When I shared my Management Systems - Time Management via Color-Coded Calendar blog post on Twitter it got some nice traction because of a generous retweet from Will Larson. In the blog post I mention automating color-coding in the future via the Google Calendar API and someone asked for me to share that system once I built it.

Striking while the iron is hot… Calendar Colorist is here!

Calendar Colorist is a simple rule-based utility written in Kotlin to color code your Google Calendar. The README on GitHub walks you through setting it up to color code your calendar. I hope it’s helpful for your color-coding needs!

P.S. For bonus points, once you’ve got it all set up, configure that personal TeamCity server you have (it’s free!) to run it once a week to fully automate this automated process!

Fully automated!

P.P.S. A few thoughts on Kotlin after taking it on this most recent whirl:

  • Kotlin’s interoperability with Java is fantastic. I used the Java version of the Google Calendar API and had zero drama getting things working. It literally just worked™️ although it would be nice if Google added nullability annotations to their code.
  • Kotlin extensions are also great for extending classes in libraries that cannot be easily edited. I added several properties and functions to the Event class via an extensions to make Events easier to work with.
  • I got tripped up using Kotlin’s let with a trailing Elvis operator ?:. I assumed in an expression like a()?.let { ... } ?: b() that so long as a() was not null b() would never get executed but turns out the ... inside the let block can end up getting us to b(). Many thanks to Heath for helping me diagnose and fix this one! 🙏