aboutsummaryrefslogtreecommitdiffstats
path: root/modules/office/calcurse/hooks/pre-load
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-09-02 17:02:13 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-09-02 17:02:13 +0530
commit627c1f723302f949e28d9df5a3acb380186b4c44 (patch)
tree6c2f2a9506a5926fd5176061706db9f3641803f1 /modules/office/calcurse/hooks/pre-load
parent9f214ab3276ff432f54a07d7d79f87c1a8be0991 (diff)
parent894f96eb131427041c2bb726b7b798edf4f683dc (diff)
downloadhome-manager-config-627c1f723302f949e28d9df5a3acb380186b4c44.tar.gz
home-manager-config-627c1f723302f949e28d9df5a3acb380186b4c44.zip
Merge branch 'calcurse'
Diffstat (limited to 'modules/office/calcurse/hooks/pre-load')
-rw-r--r--modules/office/calcurse/hooks/pre-load16
1 files changed, 16 insertions, 0 deletions
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