Some time ago, I ditched Google Photos in favour of pigallery2. See, how I expose Shotwell media gallery. Yet one feature was still left to be wished for. Google prepares appealing summaries periodically: what happened this day three-five years ago. And it shouldn’t be too complicated in GNOME Shotwell, I thought. Just go and select random photos from the database based on the date. Here’s how this idea was implemented.

First of all, I researched pigallery2 features and discovered that it can render markdown files. So if I generated one and put into a directory, it’d be served alongside the photos from the same domain. This simplifies referencing full-resolution photos a lot.

Then I spent some time coding in Python. The program would iterate over years into the past until, let’s say, the year 2000. For every year, a random set of photos are selected for the current day, ordered by time, grouped by event. And the links to the chosen photos with thumbnail previews are carefully laid out into a markdown file. The code has been kept in a local Fossil SCM repository, and this time I exported it to GitHub for publicity: daily.py

Finally, a systemd timer (or a cron job) could be used to run the program each day early in the morning. Here’s how I did it: systemd.

There’s more that could be enhanced in the future:

  • Notes could be extracted from the Shotwell database and rendered as markdown files for pigallery2
  • It should be researched how to attach generic files like GPX tracks to the events in Shotwell.

As usual, here’s an illustration:

this day