Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto synchronize xfce orage with google calendars
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
viacheslavg
n00b
n00b


Joined: 23 Sep 2016
Posts: 2

PostPosted: Fri Dec 08, 2017 11:02 am    Post subject: Howto synchronize xfce orage with google calendars Reply with quote

I spend quite some time searching for solution, but didn't find detailed guideline. In most cases folks suggest to use "read-only" approach when you periodically export/download your calendar from google and import it in orage as "foreign" calendar. But in fact it is possible to have bi-directional synchronization. Here is the steps I've made:

Step 1
Install vdirsyncer -- tool to sync calendars and contacts
Code:

# emerge dev-python/vdirsyncer

Note: In my case I was also had to install requests-oauthlib manually as it is required by vdirsyncer but doesn't pulled in automatically.
Code:

# emerge dev-python/requests-oauthlib


Step 2
Enable Google API. Go to https://console.developers.google.com
1) create an Project there (top left corner), give it some name
2) click "Enable API and services"
3) search for "CalDAV API" and enable it.
4) click "Credentials" -> Create credentials -> OAuth Client ID. Configure Consent screen first (for "Product name shown to users" type e.g. "vdirsyncer"). For "Application type" set "Other". As result you should get OAuth client ID, and client secret. Save it somewhere (will be used later)

Step 3
Configure vdirsyncer.
1) Create config dir
Code:

# mkdir -p ~/.config/vdirsyncer

2) Create config file with name "config" in created dir:
Code:

[general]
status_path = "~/.vdirsyncer/status/"

[pair mygoogle_calendar]
a = "mygoogle_calendar_local"
b = "mygoogle_calendar_remote"
collections = ["from a", "from b"]

[storage mygoogle_calendar_local]
type = "singlefile"
path = "~/.local/share/orage/mylogin@gmail.com/%s.ics"

[storage mygoogle_calendar_remote]
type = "google_calendar"
token_file = "~/.vdirsyncer/token"
client_id = "<OAuth clientID>"
client_secret = "<OAuth clientSecret>"

Here we configured two calendars: 1. local -- *.ics single file for each google calendar you have. It will be stored in orage's config directory (e.g. ~/.local/share/orage/mylogin@gmail.com/). 2. remote -- this is google calendar which will be accessed by vdirsyncer via google's API.
Also we need to put there clientId and clientSecret which we get in previous step.
Full configuration manual here https://vdirsyncer.pimutils.org/en/stable/config.html
3) create dir in orage to store google calendars
Code:

$ mkdir -p ~/.local/share/orage/mylogin@gmail.com/


Step 4
Init and authorize vdirsyncer to access google API.
Code:

$ vdirsyncer discover

At this point vdirsyncer should open web browser and go to Google's page where you will need to authenticate and authorize vdirsyncer to access your calendars. As result you should get OAuth access token, which you should copy and paste back to vdirsyncer console.

Step 5
Sync remote google calendars to local files:
Code:

$ vdirsyncer sync

As result you should get single *.ics file for each your google calendar in ~/.local/share/orage/mylogin@gmail.com/ dir.

Step 6
Add calendars to orage as "foreign" calendars (File -> Exchange data -> Foreign files....)

Step 7
Run synchronization of calendars periodically.
Add to cron something like
Code:

*/30 * * * * /usr/bin/vdirsyncer sync > /dev/null 2>&1

this will sync your calendars every 30 minutes.

We are done.
Now all changes to google's calendar will be periodically synced to your local orage's calendars, and vice versa -- all updates in orage will be propagated to google calendars.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum