- Fetch google calendar event
- Post/edit org element
- Sync between Org and Gcal
Data will be UTF-8 encoded for sync.
org-gcalis now available in the famous emacs package repo MELPA, so the recommended way is to install it through Emacs package management system.
- Go to Google Developers Console
- Create a project (with any name)
- Click on the project
- Click on APIs & Services then Credentials
- Click on Create Credentials and Oauth client ID with Application type Installed application, Installed application type Other
- Click on Create Client ID
- Record the Client ID and Client secret for setup.
- Under the same APIs & Services menu section, select Library
- Scroll down to Calendar API. Click the Enable button to enable
calendar API access to the app you created in steps 5 & 6.
Go to Google setting page to check the calendar ID.
- Go to Google setting page and click the gear-shaped settings icon in the upper right, then select “Settings” from the drop down list.
- Select the “Setting for my Calendars” tab on the left, which will display a list of your calendars.
- Select the calendar you would like to synchronize with. This will take you to the “Calendar Settings” page for that calendar. Near the end is a section titled “Integrate Calendar”. Following the XML, ICAL, and HTML tags, you will see your Calendar ID.
- Copy the Calendar ID for use in the settings below, where you will use it as the first element in the org-gcal-file-alist for associating calendars with specific org files. You can associate different calendars with different org files, so repeat this for each calendar you want to use.
(require 'org-gcal) (setq org-gcal-client-id "your-id-foo.apps.googleusercontent.com" org-gcal-client-secret "your-secret" org-gcal-file-alist '(("firstname.lastname@example.org" . "~/schedule.org") ("email@example.com" . "~/task.org")))
There’s no support for multiple accounts. If you want to use org-gcal with calendars from different accounts, you can give permissions to the account you configured via the calendar’s settings interface.
To get more detailed information you can check this link.
Sync between Org and Gcal. before syncing, execute
Fetch Google calendar events and populate
locations. The org files in
org-gcal-file-alist should be blank
or all of their headlines should have timestamps.
Post/edit org block at point to Google calendar.
Delete Gcal event at point.
Refresh the OAuth token. OAuth token expired in 3600 seconds, You should refresh token on a regular basis.
Headers in org-gcal files
Create variable org-gcal-header-alist
(setq org-gcal-header-alist '(("firstname.lastname@example.org" . "#+CATEGORY: personal\n")))
I often need to set headers in org-mode files to control categories, archive locations, and other local variables. This patch allows for the insertion of arbitary headers. It creates a single alist variable (org-gcal-header-alist) and if it exists for a given file it inserts it before writing the calendar items.
I get “Org-gcal error: Couldn’t parse your-cal.org”
The org file where you sync the calendar must have all entries with timestamps and a particular format to be parsed correctly. When synching for the first time, we recommend is to use a blank file and continue from that.