Skip to content

Instantly share code, notes, and snippets.

@4DA
Created September 14, 2021 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4DA/c991179645547ce2a4d809f9df01d048 to your computer and use it in GitHub Desktop.
Save 4DA/c991179645547ce2a4d809f9df01d048 to your computer and use it in GitHub Desktop.
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