pooruse / org-sgcal

Rewrite org-gcal for myself. Combine emacs org-mode with google calendar
1 stars 0 forks source link

** Feature

** Requirements [[https://github.com/tkf/emacs-request][emacs/request]]

** Install

  1. Enable google calendar api and generator api credential. [[https://support.google.com/googleapi/answer/6158849?hl=en&ref_topic=7013279][How to enable google calendar api]]

  2. Install emacs/request by emacs command `package-install'.

  3. Run package-install, then enter request, then enter

  4. Clone org-sgcal source code into your .emacs directory. git clone https://github.com/pooruse/org-sgcal.git

  5. Add it to load-path add command below into init.el (add-to-list 'load-path "~/.emacs.d/usr/org-sgcal") Here I clone org-sgcal into ~/.emacs.d/usr/

  6. Import package by (require 'org-sgcal) add (require 'org-sgcal) after command in previous step

** Quick Start Create an empty org file. Insert contents below

+BEGIN_EXAMPLE

** How to use the property, COLOR-ID You can learn something from [[https://eduardopereira.pt/2012/06/google-calendar-api-v3-set-color-color-chart/][this blog]], google calendar api provide 11 colors by id. You can choose it by integer from 1 to 11. (0 is calendar color depends on your calendar setting) sgcal will choose the color from COLOR-ID property according to todo-keyword.

*** format Value of COLOR-ID is an elisp plist, for example, If we have COLOR-ID with (TODO 5 DONE 6), org-sgcal will set color-id=5 when you intend to post an event with TODO todo-keyword. And set color-id=6 when todo-keyword is DONE.

** custommer varriables

*** org-sgcal-timezone This variable will effect the time zone settings in command org-sgcal-post-event. Default value is Asia/Taipei

org-sgcal-up-days org-sgcal-down-days this two variable will effect the time range of org-sgcal-fetch-all. In default setting, org-sgcal will fetch from 60 day before now to 30 day after now. * Bugs When google api oath2 token is expired, emacs requests will show "error in process filter: url-http-parse-headers: Wrong type argument: char-or-string-p, nil" and emacs will be freeze. I set the requests default timeout to 10 seconds. so If your oath2 token is expired. Emacs will be freezed about 10 second then shows "Access token expired, please run org-sgcal-update-tokens again". If you have more than 1 google api project (multi client-id) in one org file. emacs will be freezed more than 10 seconds (number of clinet-id need to dealt with 10 seconds)