From 9bcd7e4a075d91084934be30f1f2d039cf045907 Mon Sep 17 00:00:00 2001 From: Yaroslav de la Peña Smirnov Date: Sun, 31 Aug 2025 17:35:56 +0300 Subject: calcurse: add config and hooks --- dotfiles/.config/calcurse/conf | 33 ++++++++++++++++++ dotfiles/.config/calcurse/hooks/post-save | 31 +++++++++++++++++ dotfiles/.config/calcurse/hooks/pre-load | 25 ++++++++++++++ dotfiles/.config/calcurse/keys | 56 +++++++++++++++++++++++++++++++ 4 files changed, 145 insertions(+) create mode 100644 dotfiles/.config/calcurse/conf create mode 100755 dotfiles/.config/calcurse/hooks/post-save create mode 100755 dotfiles/.config/calcurse/hooks/pre-load create mode 100644 dotfiles/.config/calcurse/keys (limited to 'dotfiles/.config/calcurse') diff --git a/dotfiles/.config/calcurse/conf b/dotfiles/.config/calcurse/conf new file mode 100644 index 0000000..d1b5f1d --- /dev/null +++ b/dotfiles/.config/calcurse/conf @@ -0,0 +1,33 @@ +appearance.calendarview=monthly +appearance.compactpanels=no +appearance.defaultpanel=todo +appearance.layout=1 +appearance.headerline=yes +appearance.eventseparator=yes +appearance.dayseparator=yes +appearance.emptyline=yes +appearance.emptyday=-- +appearance.notifybar=yes +appearance.sidebarwidth=38 +appearance.theme=cyan on default +appearance.todoview=hide-completed +appearance.headingpos=right-justified +daemon.enable=no +daemon.log=no +format.inputdate=1 +format.notifydate=%a %F +format.notifytime=%T +format.appointmenttime=%H:%M +format.outputdate=%D +format.dayheading=%B %e, %Y +general.autogc=no +general.autosave=yes +general.confirmdelete=yes +general.confirmquit=yes +general.firstdayofweek=monday +general.multipledays=yes +general.periodicsave=0 +general.systemevents=yes +notification.command=printf '\a' +notification.notifyall=flagged-only +notification.warning=300 diff --git a/dotfiles/.config/calcurse/hooks/post-save b/dotfiles/.config/calcurse/hooks/post-save new file mode 100755 index 0000000..28c0ed8 --- /dev/null +++ b/dotfiles/.config/calcurse/hooks/post-save @@ -0,0 +1,31 @@ +#!/bin/sh +# +# This is an example hook. It does two things whenever you save the data files: +# +# 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 + +# Run the CalDAV synchronization script. +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 + echo + ) >>caldav/log 2>&1 +fi diff --git a/dotfiles/.config/calcurse/hooks/pre-load b/dotfiles/.config/calcurse/hooks/pre-load new file mode 100755 index 0000000..577736f --- /dev/null +++ b/dotfiles/.config/calcurse/hooks/pre-load @@ -0,0 +1,25 @@ +#!/bin/sh +# +# This is an example hook. It synchronizes calcurse with a CalDAV server before +# loading the data files. +# +# In order to install this hook, copy this file to +# $XDG_CONFIG_HOME/calcurse/hooks/ (~/.config/calcurse/hooks/) or +# ~/.calcurse/hooks/ if using ~/.calcurse. + +[ -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. +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 + echo + ) >>caldav/log 2>&1 +fi diff --git a/dotfiles/.config/calcurse/keys b/dotfiles/.config/calcurse/keys new file mode 100644 index 0000000..3304bbb --- /dev/null +++ b/dotfiles/.config/calcurse/keys @@ -0,0 +1,56 @@ +# +# Calcurse keys configuration file +# +# In this file the keybindings used by Calcurse are defined. +# It is generated automatically by Calcurse and is maintained +# via the key configuration menu of the interactive user +# interface. It should not be edited directly. + +generic-cancel ESC +generic-select SPC +generic-credits @ +generic-help ? +generic-quit q Q +generic-save s S ^S +generic-reload R +generic-copy c +generic-paste p ^V +generic-change-view TAB +generic-prev-view KEY_BTAB +generic-import i I +generic-export x X +generic-goto g G +generic-other-cmd o O +generic-config-menu C +generic-redraw ^R +generic-add-appt ^A +generic-add-todo ^T +generic-prev-day T ^H +generic-next-day t ^L +generic-prev-week W ^K +generic-next-week w +generic-prev-month M +generic-next-month m +generic-prev-year Y +generic-next-year y +generic-scroll-down ^N +generic-scroll-up ^P +generic-goto-today ^G +generic-command : +move-right l L RGT +move-left h H LFT +move-down j J DWN +move-up k K UP +start-of-week 0 +end-of-week $ +add-item a A +del-item d D +edit-item e E +view-item v V RET +pipe-item | +flag-item ! +repeat r +edit-note n N +view-note > +raise-priority + +lower-priority - -- cgit v1.2.3