diff options
Diffstat (limited to '.config/calcurse/hooks/pre-load')
-rwxr-xr-x | .config/calcurse/hooks/pre-load | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.config/calcurse/hooks/pre-load b/.config/calcurse/hooks/pre-load new file mode 100755 index 0000000..dc25771 --- /dev/null +++ b/.config/calcurse/hooks/pre-load | |||
@@ -0,0 +1,17 @@ | |||
1 | #!/bin/sh | ||
2 | [ -d "$HOME/.calcurse" ] && data_dir="$HOME/.calcurse" || data_dir="${XDG_DATA_HOME:-$HOME/.local/share}/calcurse" | ||
3 | |||
4 | cd "$data_dir" || exit | ||
5 | |||
6 | # Do not do anything when synchronizing with a CalDAV server. | ||
7 | [ -f caldav/lock ] && exit | ||
8 | |||
9 | # Run the CalDAV synchronization script in the background. | ||
10 | if [ -d caldav ] && command -v calcurse-caldav >/dev/null; then | ||
11 | ( | ||
12 | date="$(date +'%b %d %H:%M:%S')" | ||
13 | echo "$date Running calcurse-caldav from the pre-load hook..." | ||
14 | CALCURSE_CALDAV_PASSWORD=$(pass web/radicale.chudnick.com | head -1) calcurse-caldav | ||
15 | echo | ||
16 | ) >>caldav/log 2>&1 & | ||
17 | fi | ||