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/post-save | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modules/office/calcurse/hooks/post-save (limited to 'modules/office/calcurse/hooks/post-save') diff --git a/modules/office/calcurse/hooks/post-save b/modules/office/calcurse/hooks/post-save new file mode 100644 index 0000000..5d2ab1d --- /dev/null +++ b/modules/office/calcurse/hooks/post-save @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Commits and pushes the calcurse data dir after every save. +# +# Hooks hand calcurse's terminal over to whatever they run and calcurse +# waits for them to exit before redrawing, so this backgrounds the actual +# sync instead of blocking the UI on a git push. Output goes to a log +# file rather than stdout/stderr, since hooks aren't meant to be +# interactive. + +log="${XDG_DATA_HOME:-$HOME/.local/share}/calcurse/hooks.log" + +( + printf '[%s] post-save\n' "$(date '+%Y-%m-%d %H:%M:%S')" + calcurse-sync sync +) >>"$log" 2>&1 & +disown -- cgit v1.2.3