aboutsummaryrefslogtreecommitdiff
path: root/.emacs.local.d/modes/org.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.local.d/modes/org.el')
-rw-r--r--.emacs.local.d/modes/org.el29
1 files changed, 28 insertions, 1 deletions
diff --git a/.emacs.local.d/modes/org.el b/.emacs.local.d/modes/org.el
index ce4695a..c22047e 100644
--- a/.emacs.local.d/modes/org.el
+++ b/.emacs.local.d/modes/org.el
@@ -110,7 +110,15 @@
;; Based on Prot's config:
;; https://protesilaos.com/codelog/2021-12-09-emacs-org-block-agenda/
(setq my-org-agenda-custom-commands
- `(("P" "Projects and tasks"
+ `(
+ ("X" "Export files" agenda "-CANCELLED"
+ ((org-agenda-with-colors nil)
+ (org-agenda-prefix-format "%t %s")
+ (org-agenda-current-time-string ,(car (last org-agenda-time-grid)))
+ (org-agenda-fontify-priorities nil)
+ (org-agenda-remove-tags t))
+ ,(list my-org-agenda-private-local-path))
+ ("P" "Projects and tasks"
(
(agenda "" (
(org-agenda-overriding-header "📌 Today's agenda\n")
@@ -686,3 +694,22 @@ as the default task."
;; org-modern
(add-hook 'org-mode-hook 'org-modern-mode)
(add-hook 'org-agenda-finalize-hook #'org-modern-agenda)
+
+;; Credits: https://200ok.ch/posts/2022-02-13_integrating_org_mode_agenda_into_other_calendar_apps.html
+(defun org-agenda-export-to-ics ()
+ (set-org-agenda-files)
+ ;; Run all custom agenda commands that have a file argument.
+ (org-batch-store-agenda-views)
+
+ ;; Org mode correctly exports TODO keywords as VTODO events in ICS.
+ ;; However, some proprietary calendars do not really work with
+ ;; standards (looking at you Google), so VTODO is ignored and only
+ ;; VEVENT is read.
+ (with-current-buffer (find-file-noselect org-agenda-private-local-path)
+ (goto-char (point-min))
+ (while (re-search-forward "VTODO" nil t)
+ (replace-match "VEVENT"))
+ (save-buffer))
+
+ ;; Copy the ICS file to a remote server (Tramp paths work).
+ (copy-file org-agenda-private-local-path org-agenda-private-remote-path t))
nihil fit ex nihilo