From 12ce8bdd65d3b5fcd6e8227eaecd5f772a90f8da Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sun, 11 Jun 2023 08:00:24 -0400 Subject: Configuration file updates and additions. --- .config/calcurse/caldav/config | 13 +++++++++++ .config/calcurse/conf | 16 +++++++------- .config/calcurse/hooks/post-save | 47 ++++++++++++++++++++++++++++++++++++++++ .config/calcurse/hooks/pre-load | 17 +++++++++++++++ .config/calcurse/keys | 4 ++-- 5 files changed, 87 insertions(+), 10 deletions(-) create mode 100644 .config/calcurse/caldav/config create mode 100755 .config/calcurse/hooks/post-save create mode 100755 .config/calcurse/hooks/pre-load (limited to '.config/calcurse') 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 @@ +[General] +Binary = calcurse +Hostname = radicale.chudnick.com:443 +Path = /sam/d1b7aa05-a00b-cb40-bdef-b6ed70a23944/ +AuthMethod = basic +InsecureSSL = No +HTTPS = Yes +DryRun = No +Verbose = Yes +SyncFilter = cal + +[Auth] +Username = 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 @@ appearance.calendarview=monthly appearance.compactpanels=no -appearance.defaultpanel=calendar +appearance.defaultpanel=todo appearance.layout=5 appearance.notifybar=yes -appearance.sidebarwidth=2 -appearance.theme=blue on default +appearance.sidebarwidth=22 +appearance.theme=cyan on default appearance.todoview=hide-completed appearance.headingpos=right-justified -daemon.enable=no +daemon.enable=yes daemon.log=no format.inputdate=1 format.notifydate=%a %F @@ -19,10 +19,10 @@ general.autosave=yes general.confirmdelete=yes general.confirmquit=no general.firstdayofweek=monday -general.periodicsave=0 -general.systemdialogs=yes -notification.command=printf '\a' -notification.notifyall=flagged-only +general.periodicsave=10 +general.systemdialogs=no +notification.command=notify-send "Upcoming Appointment" +notification.notifyall=all notification.warning=300 appearance.headerline=yes appearance.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 @@ +#!/bin/sh +# +# This is an example hook. It does two things whenever you save the data files: +# +# 1. Make a commit if the calcurse directories contain a Git repository. +# 2. Synchronize with a CalDAV server if calcurse-caldav is configured. +# +# In order to install this hook, copy this file to +# $XDG_CONFIG_HOME/calcurse/hooks/ (~/.config/calcurse/hooks/) or +# ~/.calcurse/hooks/ if using ~/.calcurse. + +data_dir="$HOME/.calcurse" +config_dir="$HOME/.calcurse" + +if [ ! -d "$data_dir" ]; then + data_dir="${XDG_DATA_HOME:-$HOME/.local/share}/calcurse" + config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/calcurse" +fi + +# Do not do anything when synchronizing with a CalDAV server. +[ -f "$data_dir/caldav/lock" ] && exit + +# If the directory is under version control, create a Git commit. +commit_dir() { + cd "$1" >/dev/null 2>&1 || return + shift + if [ -d .git ] && command -v git >/dev/null; then + git add "$@" + if ! git diff-index --quiet --cached HEAD; then + git commit -m "Automatic commit by the post-save hook" + fi + fi +} + +commit_dir "$data_dir" apts todo +commit_dir "$config_dir" conf keys + +# Optionally run the CalDAV synchronization script in the background. +cd "$data_dir" || exit +if [ -d caldav ] && command -v calcurse-caldav >/dev/null; then + ( + date="$(date +'%b %d %H:%M:%S')" + echo "$date Running calcurse-caldav from the post-save hook..." + CALCURSE_CALDAV_PASSWORD=$(pass show web/radicale.chudnick.com | head -1) calcurse-caldav + echo + ) >>caldav/log 2>&1 & +fi 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 @@ +#!/bin/sh +[ -d "$HOME/.calcurse" ] && data_dir="$HOME/.calcurse" || data_dir="${XDG_DATA_HOME:-$HOME/.local/share}/calcurse" + +cd "$data_dir" || exit + +# Do not do anything when synchronizing with a CalDAV server. +[ -f caldav/lock ] && exit + +# Run the CalDAV synchronization script in the background. +if [ -d caldav ] && command -v calcurse-caldav >/dev/null; then + ( + date="$(date +'%b %d %H:%M:%S')" + echo "$date Running calcurse-caldav from the pre-load hook..." + CALCURSE_CALDAV_PASSWORD=$(pass web/radicale.chudnick.com | head -1) calcurse-caldav + echo + ) >>caldav/log 2>&1 & +fi 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 generic-prev-day T ^H generic-next-day t ^L generic-prev-week W ^K -generic-next-week w RET +generic-next-week w generic-prev-month M generic-next-month m generic-prev-year Y @@ -45,7 +45,7 @@ end-of-week $ add-item a A del-item d D edit-item e E -view-item v V +view-item v V RET pipe-item | flag-item ! repeat r -- cgit v1.2.3