Files
calcurse-gcal/hooks/post-save
T
Daniele Fucini 8ed6a2b18a Initial import of the calcurse Google Calendar sync from the dotfiles
Scripts, user units and hooks moved to system paths, the xmobar script as calcurse-xmobar with colour options, and expiry detection that also catches the first invalid_grant failure.
2026-11-21 15:32:34 +01:00

7 lines
419 B
Bash
Executable File

#!/bin/sh
# Sync the UI's saved changes once it exits (syncing while it runs would change files under it).
[ "$(ps -o args= -p "$PPID")" = calcurse ] && [ "$(ps -o tty= -p "$PPID" | tr -d ' ')" != '?' ] || exit 0
# shellcheck disable=SC2016 # $1 expands in the inner shell
setsid -f sh -c 'while kill -0 "$1" 2>/dev/null; do sleep 1; done; systemctl --user start calcurse-sync.service' \
sh "$PPID" >/dev/null 2>&1