Skip to content

Instantly share code, notes, and snippets.

@4DA
Created Sep 14, 2021
Embed
What would you like to do?
sync org files with caldav (one way)
#!/usr/bin/emacs --script
;; config
;; storing creds in authinfo
;; https://github.com/dengste/org-caldav#storing-authentication-information-in-authinfonetrc
;; MELPA and use-package stuff -------------------------------------------------
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(eval-when-compile
(require 'use-package))
;; -----------------------------------------------------------------------------
(use-package org-caldav
:ensure t
:config
(progn
(setq org-caldav-url
"https://caldav.fastmail.com/dav/calendars/user/")
(setq org-caldav-calendar-id "")
(setq org-caldav-inbox (expand-file-name "~/orgzly/inbox.org"))
(setq org-caldav-files (mapcar 'expand-file-name `("~/orgzly/todo.org")))
(setq org-caldav-sync-direction 'org->cal)))
(setq org-icalendar-include-todo 'all
org-icalendar-use-deadline '(event-if-not-todo todo-due)
org-icalendar-use-scheduled '(todo-start event-if-todo event-if-not-todo)
org-icalendar-with-timestamps t)
;; does all the work
(org-caldav-sync)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment