diff --git a/home/roles/emacs/doom/config.el b/home/roles/emacs/doom/config.el index f1c1ad8..c57c70e 100644 --- a/home/roles/emacs/doom/config.el +++ b/home/roles/emacs/doom/config.el @@ -86,7 +86,7 @@ ;; org-caldav: Sync Org entries with Nextcloud CalDAV ;; Setup requirements: ;; 1. Create Nextcloud app password: Settings -> Security -> Devices & sessions -;; 2. Store in rbw: rbw add nextcloud-caldav (username in notes, app password as secret) +;; 2. Store in rbw: rbw add nextcloud-caldav (put app password as the secret) ;; 3. Run: doom sync ;; 4. Test: M-x org-caldav-sync ;; @@ -97,11 +97,22 @@ :commands (org-caldav-sync) :init (map! :leader - :desc "Sync calendar" "o C" #'org-caldav-sync) + :desc "Sync calendar" "o C" #'my/org-caldav-sync-with-rbw) :config ;; Nextcloud CalDAV base URL (setq org-caldav-url "https://nextcloud.johnogle.info/remote.php/dav/calendars/johno") + ;; Configure auth using rbw (bypasses need for GPG/.authinfo.gpg) + (defun my/org-caldav-sync-with-rbw () + "Run org-caldav-sync with credentials from rbw." + (interactive) + (let* ((password (my/get-rbw-password "nextcloud-caldav")) + (auth-entry (list "nextcloud.johnogle.info:443" + (cons "johno" password)))) + ;; Set up URL auth cache + (setq url-http-basic-auth-storage (list auth-entry)) + (org-caldav-sync))) + ;; Timezone for iCalendar export (setq org-icalendar-timezone "America/Los_Angeles")