From c64bf67e15b075182deb4eebead8315c9081ac46 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 18 Sep 2026 09:26:32 +0200 Subject: feat: add a calendar card reading khal The month grid with the week's appointments below it, colour-coded by calendar. Events come from a cache file rather than a live call: khal costs about 200ms of Python startup, which is two orders of magnitude over the 2-second draw budget, so bin/calendar-sample.sh writes the cache on a 5-minute execi and the widget only parses. Calendar colours are read out of khal's own config by the sampler and mapped onto the board's palette roles, so the card follows a scheme change instead of pinning three literal hues. khal will not emit an ISO date: {start-date} uses the user's dateformat, which carries no year here, and a strftime spec inside the field raises. The sampler asks for {start-date-long} and data.calendar_date recovers the numbers by position, resolving day/month by magnitude and reading a genuinely ambiguous pair day-first. A 2-digit year is refused rather than guessed at. Co-Authored-By: Claude Opus 5 --- test/fixtures/calendar_cache | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/fixtures/calendar_cache (limited to 'test/fixtures/calendar_cache') diff --git a/test/fixtures/calendar_cache b/test/fixtures/calendar_cache new file mode 100644 index 0000000..c31ab94 --- /dev/null +++ b/test/fixtures/calendar_cache @@ -0,0 +1,10 @@ +generated 1789700000 +today 2026-09-18 +color personal light green +color birthdays light magenta +color work light blue +event 18.09.2026|13:00|13:30|personal|Dentist +event 18.09.2026|||birthdays|A birthday +event 24.09.2026|14:30|15:30|work|Team sync | notes +event 26.09.2026|||birthdays|Another birthday +event 02.10.2026|09:00|10:00|work|Review -- cgit v1.2.3