summaryrefslogtreecommitdiff
path: root/.config/calcurse
diff options
context:
space:
mode:
authorSam Chudnick <sam@chudnick.com>2023-06-11 08:00:24 -0400
committerSam Chudnick <sam@chudnick.com>2023-06-11 08:00:24 -0400
commit12ce8bdd65d3b5fcd6e8227eaecd5f772a90f8da (patch)
tree5be7566c5ef41877e1d03a013667fdae1aedf252 /.config/calcurse
parent9e82c96713989a7565eadac505b36e3dbe91cd5a (diff)
Configuration file updates and additions.
Diffstat (limited to '.config/calcurse')
-rw-r--r--.config/calcurse/caldav/config13
-rw-r--r--.config/calcurse/conf16
-rwxr-xr-x.config/calcurse/hooks/post-save47
-rwxr-xr-x.config/calcurse/hooks/pre-load17
-rw-r--r--.config/calcurse/keys4
5 files changed, 87 insertions, 10 deletions
diff --git a/.config/calcurse/caldav/config b/.config/calcurse/caldav/config
new file mode 100644
index 0000000..75dfada
--- /dev/null
+++ b/.config/calcurse/caldav/config
@@ -0,0 +1,13 @@
1[General]
2Binary = calcurse
3Hostname = radicale.chudnick.com:443
4Path = /sam/d1b7aa05-a00b-cb40-bdef-b6ed70a23944/
5AuthMethod = basic
6InsecureSSL = No
7HTTPS = Yes
8DryRun = No
9Verbose = Yes
10SyncFilter = cal
11
12[Auth]
13Username = sam
diff --git a/.config/calcurse/conf b/.config/calcurse/conf
index b46b0a7..ecf4bba 100644
--- a/.config/calcurse/conf
+++ b/.config/calcurse/conf
@@ -1,13 +1,13 @@
1appearance.calendarview=monthly 1appearance.calendarview=monthly
2appearance.compactpanels=no 2appearance.compactpanels=no
3appearance.defaultpanel=calendar 3appearance.defaultpanel=todo
4appearance.layout=5 4appearance.layout=5
5appearance.notifybar=yes 5appearance.notifybar=yes
6appearance.sidebarwidth=2 6appearance.sidebarwidth=22
7appearance.theme=blue on default 7appearance.theme=cyan on default
8appearance.todoview=hide-completed 8appearance.todoview=hide-completed
9appearance.headingpos=right-justified 9appearance.headingpos=right-justified
10daemon.enable=no 10daemon.enable=yes
11daemon.log=no 11daemon.log=no
12format.inputdate=1 12format.inputdate=1
13format.notifydate=%a %F 13format.notifydate=%a %F
@@ -19,10 +19,10 @@ general.autosave=yes
19general.confirmdelete=yes 19general.confirmdelete=yes
20general.confirmquit=no 20general.confirmquit=no
21general.firstdayofweek=monday 21general.firstdayofweek=monday
22general.periodicsave=0 22general.periodicsave=10
23general.systemdialogs=yes 23general.systemdialogs=no
24notification.command=printf '\a' 24notification.command=notify-send "Upcoming Appointment"
25notification.notifyall=flagged-only 25notification.notifyall=all
26notification.warning=300 26notification.warning=300
27appearance.headerline=yes 27appearance.headerline=yes
28appearance.eventseparator=yes 28appearance.eventseparator=yes
diff --git a/.config/calcurse/hooks/post-save b/.config/calcurse/hooks/post-save
new file mode 100755
index 0000000..8836316
--- /dev/null
+++ b/.config/calcurse/hooks/post-save
@@ -0,0 +1,47 @@
1#!/bin/sh
2#
3# This is an example hook. It does two things whenever you save the data files:
4#
5# 1. Make a commit if the calcurse directories contain a Git repository.
6# 2. Synchronize with a CalDAV server if calcurse-caldav is configured.
7#
8# In order to install this hook, copy this file to
9# $XDG_CONFIG_HOME/calcurse/hooks/ (~/.config/calcurse/hooks/) or
10# ~/.calcurse/hooks/ if using ~/.calcurse.
11
12data_dir="$HOME/.calcurse"
13config_dir="$HOME/.calcurse"
14
15if [ ! -d "$data_dir" ]; then
16 data_dir="${XDG_DATA_HOME:-$HOME/.local/share}/calcurse"
17 config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/calcurse"
18fi
19
20# Do not do anything when synchronizing with a CalDAV server.
21[ -f "$data_dir/caldav/lock" ] && exit
22
23# If the directory is under version control, create a Git commit.
24commit_dir() {
25 cd "$1" >/dev/null 2>&1 || return
26 shift
27 if [ -d .git ] && command -v git >/dev/null; then
28 git add "$@"
29 if ! git diff-index --quiet --cached HEAD; then
30 git commit -m "Automatic commit by the post-save hook"
31 fi
32 fi
33}
34
35commit_dir "$data_dir" apts todo
36commit_dir "$config_dir" conf keys
37
38# Optionally run the CalDAV synchronization script in the background.
39cd "$data_dir" || exit
40if [ -d caldav ] && command -v calcurse-caldav >/dev/null; then
41 (
42 date="$(date +'%b %d %H:%M:%S')"
43 echo "$date Running calcurse-caldav from the post-save hook..."
44 CALCURSE_CALDAV_PASSWORD=$(pass show web/radicale.chudnick.com | head -1) calcurse-caldav
45 echo
46 ) >>caldav/log 2>&1 &
47fi
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
4cd "$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.
10if [ -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 &
17fi
diff --git a/.config/calcurse/keys b/.config/calcurse/keys
index 301d367..0f5ee8d 100644
--- a/.config/calcurse/keys
+++ b/.config/calcurse/keys
@@ -27,7 +27,7 @@ generic-add-todo ^T
27generic-prev-day T ^H 27generic-prev-day T ^H
28generic-next-day t ^L 28generic-next-day t ^L
29generic-prev-week W ^K 29generic-prev-week W ^K
30generic-next-week w RET 30generic-next-week w
31generic-prev-month M 31generic-prev-month M
32generic-next-month m 32generic-next-month m
33generic-prev-year Y 33generic-prev-year Y
@@ -45,7 +45,7 @@ end-of-week $
45add-item a A 45add-item a A
46del-item d D 46del-item d D
47edit-item e E 47edit-item e E
48view-item v V 48view-item v V RET
49pipe-item | 49pipe-item |
50flag-item ! 50flag-item !
51repeat r 51repeat r