Commit cfd2126317ed

Vincent Demeester <vincent@sbr.pm>
2020-03-07 22:35:14
Try org-gcal to get work calendar ๐Ÿ“†
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent c577d1f
Changed files (2)
config/setup-org.el
@@ -162,6 +162,20 @@
          ("<f12>" . org-agenda)
          ("C-c o r a" . org-agenda-refile)))
 
+(use-package org-gcal
+  :after (org)
+  :config
+  (require 'netrc)
+
+  (defun get-authinfo (host port)
+    (let* ((netrc (netrc-parse (expand-file-name "~/.authinfo.gpg")))
+           (hostentry (netrc-machine netrc host port port)))
+      (when hostentry (netrc-get hostentry "password"))))
+
+  (setq org-gcal-client-id "959564825992-kvc7ofe9640cpc8ibgjqqgpi15e89nkn.apps.googleusercontent.com"
+        org-gcal-client-secret (get-authinfo "gcal.api" "9999")
+        org-gcal-file-alist '(("vdemeest@redhat.com" . "~/desktop/org/projects/schedule.org"))))
+
 (use-package org-habit
   :after (org)
   :config
emacs.org
@@ -985,6 +985,25 @@
          ("C-c o r a" . org-agenda-refile)))
 #+end_src
 
+Let's try to get my work calendar entries in my agenda too. It is a little bit tricky ๐Ÿ‘ผ.
+
+#+begin_src emacs-lisp
+(use-package org-gcal
+  :after (org)
+  :config
+  (require 'netrc)
+
+  (defun get-authinfo (host port)
+    (let* ((netrc (netrc-parse (expand-file-name "~/.authinfo.gpg")))
+           (hostentry (netrc-machine netrc host port port)))
+      (when hostentry (netrc-get hostentry "password"))))
+
+  (setq org-gcal-client-id "959564825992-kvc7ofe9640cpc8ibgjqqgpi15e89nkn.apps.googleusercontent.com"
+        org-gcal-client-secret (get-authinfo "gcal.api" "9999")
+        org-gcal-file-alist '(("vdemeest@redhat.com" . "~/desktop/org/projects/schedule.org"))))
+#+end_src
+
+
 *** Habits                                                         :ATTACH:
 :PROPERTIES:
 :CUSTOM_ID: h:291bae2c-f3eb-4c2a-9415-606afa28ac86
@@ -1566,7 +1585,6 @@
   (add-to-list 'mm-body-charset-encoding-alist '(utf-8 . base64)))
 #+end_src
 
-
 * User interface and interactions
 :PROPERTIES:
 :CUSTOM_ID: h:93826a52-2f51-437b-8625-ce7cd36d53b6