From 0afbd64a18aef6c048fba40d1c1350dbcdc4930a Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Wed, 2 Sep 2026 02:34:32 +0530 Subject: feat(office/calcurse): added hooks for calcurse-sync - saving and loading automatically syncs the local with a remote upstream git repo --- modules/office/calcurse/hooks/pre-load | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modules/office/calcurse/hooks/pre-load (limited to 'modules/office/calcurse/hooks/pre-load') diff --git a/modules/office/calcurse/hooks/pre-load b/modules/office/calcurse/hooks/pre-load new file mode 100644 index 0000000..bd87af3 --- /dev/null +++ b/modules/office/calcurse/hooks/pre-load @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Pulls the latest calcurse data before calcurse reads it, so a fresh +# session (or a ^R reload) starts from wherever you last left off on +# another machine. +# +# Runs synchronously, unlike post-save, since the point is to have +# up-to-date data before it's loaded. Never fails calcurse's startup, +# though: if the pull can't complete (offline, no remote configured +# yet, a conflict), calcurse just opens with whatever's on disk. + +log="${XDG_DATA_HOME:-$HOME/.local/share}/calcurse/hooks.log" + +{ + printf '[%s] pre-load\n' "$(date '+%Y-%m-%d %H:%M:%S')" + calcurse-sync pull +} >>"$log" 2>&1 || true -- cgit v1.2.3