diff options
author | Sam Chudnick <sam@chudnick.com> | 2023-06-11 08:00:24 -0400 |
---|---|---|
committer | Sam Chudnick <sam@chudnick.com> | 2023-06-11 08:00:24 -0400 |
commit | 12ce8bdd65d3b5fcd6e8227eaecd5f772a90f8da (patch) | |
tree | 5be7566c5ef41877e1d03a013667fdae1aedf252 /.config/calcurse/hooks/pre-load | |
parent | 9e82c96713989a7565eadac505b36e3dbe91cd5a (diff) |
Configuration file updates and additions.
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 | ||