diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-29 13:33:14 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-29 13:33:14 +0200 |
| commit | 9624351d80ace747d3117fb22d6cbd00fce3eedf (patch) | |
| tree | f9adc0a04445718d2d2b5e1b659b00fb8373c73c /test/test_data.lua | |
| parent | 272c5732b0bc932749f0e771de51ee49f6cebe5b (diff) | |
| download | conky-theme-udt-9624351d80ace747d3117fb22d6cbd00fce3eedf.tar.gz conky-theme-udt-9624351d80ace747d3117fb22d6cbd00fce3eedf.zip | |
feat: add an Immich memories card with click and scroll
A centred card showing today's "N years ago" photos from Immich, one at
a time on a 30-second rotation, with when each was taken and where.
bin/immich-fetch.sh runs from conky's execi every 30 minutes: it asks
/api/memories for today, converts each preview to PNG (Cairo loads
nothing else) and writes an index with the year, local capture time and
place. The place needs the key's asset.read permission and reads '--'
without it. The key lives in ~/.config/udt/immich.env, like the weather
key, because a GPG-backed store would raise a pinentry unattended.
The dashboard now registers lua_mouse_hook and hands pointer events to
the widget under the pointer. On this card, scrolling steps through the
photos and a left click opens the photo in Immich's web UI and hides the
dashboard so the browser is not stuck beneath it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'test/test_data.lua')
| -rw-r--r-- | test/test_data.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_data.lua b/test/test_data.lua index 65f92e1..7b84b3d 100644 --- a/test/test_data.lua +++ b/test/test_data.lua @@ -445,4 +445,17 @@ assert(data.breaktimer_parse('running no\n') == nil, 'no generated key: nil') assert(data.breaktimer_parse('') == nil, 'empty cache: nil') assert(data.breaktimer_parse(nil) == nil, 'nil cache: nil') +-- immich_parse: one entry per photo line, place optional, garbage skipped. +local im = data.immich_parse(read('test/fixtures/immich_index')) +assert(im and #im == 3, 'immich photo count, got ' .. tostring(im and #im)) +assert(im[1].year == 2014 and im[1].place == 'Example City, Italy', 'immich first photo') +assert(table.concat(im[1].taken, ' ') == '2014 9 29 19 33', 'immich taken parses') +assert(im.url == 'http://immich.example.org:2283', 'immich url parses') +assert(im[2].place == nil, 'empty place: nil, so the card prints --') +assert(im[3].taken == nil and im[3].place == '40.123, 9.456', 'missing date, coords place') +assert(data.immich_parse('photo a|2014||\n') == nil, 'no generated key: nil') +assert(data.immich_parse(nil) == nil, 'nil index: nil') +local none = data.immich_parse('generated 1\n') +assert(none and #none == 0, 'no memories today: empty list, not nil') + print('test_data: all assertions passed') |
