From fee71e703c9b01272d732d10f9524630cd6a7528 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 30 Oct 2023 07:03:37 +0000 Subject: [PATCH] Add khalel and config to sync ics files into org-agenda Updage khal format strings to work with khalel Remove syncing display name as contact birthdays messes with khalel tagging (because of the space) --- home/accounts/calendar.nix | 14 +++++++++++--- home/emacs/modules/custom-org-config.el | 7 +++++++ system/emacs.nix | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/home/accounts/calendar.nix b/home/accounts/calendar.nix index 6619da01..4069ae03 100644 --- a/home/accounts/calendar.nix +++ b/home/accounts/calendar.nix @@ -3,7 +3,16 @@ { programs = { vdirsyncer.enable = true; - khal.enable = true; + khal = { + enable = true; + locale = { + timeformat = "%H:%M"; + dateformat = "%Y-%m-%d"; + longdateformat = "%Y-%m-%d %a"; + datetimeformat = "%Y-%m-%d %H:%M"; + longdatetimeformat = "%Y-%m-%d %H:%M"; + }; + }; }; services.vdirsyncer.enable = true; accounts.calendar = { @@ -32,7 +41,7 @@ vdirsyncer = { enable = lib.mkDefault true; collections = [ "from a" ]; - metadata = [ "color" "displayname" ]; + metadata = [ "color" ]; }; khal = { inherit (vdirsyncer) enable; @@ -52,7 +61,6 @@ vdirsyncer = { enable = lib.mkDefault emailConfig.mbsync.enable; collections = [ "Work" "Operations" ]; - metadata = [ "displayname" ]; }; khal = { inherit (vdirsyncer) enable; diff --git a/home/emacs/modules/custom-org-config.el b/home/emacs/modules/custom-org-config.el index c99b5c87..6423b226 100644 --- a/home/emacs/modules/custom-org-config.el +++ b/home/emacs/modules/custom-org-config.el @@ -49,4 +49,11 @@ :emptry-lines 1) )) +(when (require 'khalel nil :noerror) + (setq khalel-import-org-file-read-only nil + khalel-import-org-file (expand-file-name "calendar.org" org-directory) + khalel-import-start-date "-30d" + khalel-import-end-date "+30d") + (khalel-add-capture-template "e")) + (provide 'custom-org-config) diff --git a/system/emacs.nix b/system/emacs.nix index 43a0ffe0..d7c512d3 100644 --- a/system/emacs.nix +++ b/system/emacs.nix @@ -55,6 +55,7 @@ org-cliplink org-journal org-modern + khalel # project-packages magit