Some consider this to be an impossible feat, and until lately, I too, thought I was doomed to out of sync calendaring between my mobile calendar with notifications (Google calendar) and my always on screen calendar in org-agenda. Well - no longer!
In this piece, I will show you how I set this up, how I manage events/deadlines, and how I never forget to be somewhere at any given time, or do something before it is due.
The setup
Setup Environment variables and get Google client authentication
I use doom emacs, and from there, we create a /private
directory in our /doom
directory and .gitignore it. We will then create a /doom/private/org-gcal-credentials.el
file which will store the configuration for our google calendar (and contain our google app credentials, which is why it is in the private directory).
The file should appear as follows:
;;; org-gcal-credentials.el -*- lexical-binding: t; -*-
;;;
;;; This file contains private credentials for org-gcal and is not under version control.
;;; It's loaded by my main config.el file.
;; Set up org-gcal with Google API credentials
(after! org
(use-package! org-gcal
:config
;; Direct configuration with credentials
(setq org-gcal-client-id ""
org-gcal-client-secret ""
org-gcal-file-alist '(("" . "~/org/calendar.org")) ;; this is the file I use for events/deadlines
org-gcal-request-ptbr t
org-gcal-token-file nil
org-gcal-fetch-event-filters '((lambda (event)
(let ((start (org-gcal--get-time-and-desc event 'start)))
(time-less-p (current-time) (org-gcal--parse-date start)))))
org-gcal-notify-p t)
;; Force account selection by modifying the auth URL
(defadvice org-gcal--get-auth-url (after force-account-selection activate)
"Add prompt=select_account to force Google account selection."
(setq ad-return-value
(concat ad-return-value "&prompt=select_account&access_type=offline")))))
(provide 'org-gcal-credentials)
We get these by navigating to https://console.cloud.google.com/ and creating a project that allows the google calendar API. Enable this service, then create a desktop app.
Go to APIs and Services > Credentials and copy your client ID and secret put them in their respective places in the file we created
Setup config.el and enable org-gcal package
Add (package! org-gcal)
to your packages list
and in your config.el:
;; Call this lisp file from your config.el
(let ((private-config (expand-file-name "private/org-gcal-credentials.el" doom-private-dir)))
(when (file-exists-p private-config)
(load private-config)))
This will allow you to sync events that are forward looking.
Login and sync
Restart emacs and call M-x org-gcal-reload-client-id-secret
and then M-x org-gcal-sync
You will be prompted to login and allow the app in google, as well as enter a password. This password is for emacs to encrypt the entry for future use, enter a password you'd like for this.
Create an event
In your file that you defined (I use ~/org/calendar.org) for events/deadlines, create an event and add a date/time for it like so:
Test event
:PROPERTIES:
:calendar-id: joshuascalendar@gmail.com
:org-gcal-managed: org
:END:
<2025-04-10 Thu 07:42>
:PROPERTIES:
:CREATED: [2025-04-03 Thu 07:42]
:CAPTURED:
:CONTACT: [[id:nil][none]]
:END:
You can then sync that event to your calendar by calling M-x org-gcal-post-at-point
, this will connect to your calendar and push the event to it. You should then see the event in your google calendar and on your mobile device.
Sync your calendar to org:
Simply call M-x org-gcal-sync
and you should sync down events to your org file that are in your google calendar.
Why would I want to do this?
I don't like Google as much as the next guy, but the calendaring is accessible from anywhere, on mobile, and has good notifications, so I don't forget to be places, or to do things by their deadline. I have tried other methods and they fail at various points, which is not good when I needed to be somewhere an hour ago.
I love managing my calendar in org, as I have the power of emacs at my finger tips, while also allowing me to get the benefits of a polished calendaring system that doesn't fail me.
If you have other methods of managing your calendar from within org-mode, feel free to comment below or email me!
As always, God bless, and until next time.
If you enjoyed this post, consider supporting my work by Buying me a Coffee, Checking out my book, or sending me an email to tell me what you think.