UPDATE: This page describes the
tw_gcal_sync
app, which bi-directionally synchronizes your Taskwarrior items with Google Calendar events. Since then a new synchronization has been created which synchronizes your Taskwarrior items with Google Tasks TODO items which in the majority of cases should be more suitable for you to use. To use the latter, head over to the TW ⬄ Google Tasks README
Given all the entries of a Calendar in Google Calendar with all the tasks of a Taskwarrior filter (combination of tags and projects) synchronise all the addition/modification/deletion events between them.
While Taskwarrior is an excellent tool when it comes to keeping TODO lists, keeping track of project goals etc., lacks the portability, simplicity and minimalistic design of Google Calendar. The latter also has the following advantages:
- Automatic sync across all your devices
- Comfortable addition/modification of events using voice commands
- Actual reminding of events with a variety of mechanisms
Unfortunately I have not yet verified this app with Google so new users are currently blocked from using it. To bypass that you can register for your own developer account with the Google Calendar API with the following steps:
Firstly, remove the ~/.gcal_credentials.pickle
file on your system since that
will be reused if found by the app.
For creating your own Google Developer App:
- Go to the Google developer console
- Make a new project
- From the sidebar go to
API & Services
and once there click theENABLE APIS AND SERVICES
button - Look for and Enable the
Calendar API
Your newly created app now has access to the Calendar API. We now have to create and download the credentials:
-
Again, from the sidebar under
API And Services
clickCredentials
-
Enable the
Calendar API
-
On the sidebar click
Credentials
, and once there clickCREATE CREDENTIALS
-
Create a new
OAuth Client ID
. Set the type toDesktop App
(app name is not important). -
Finally download the credentials in JSON form by clicking the download button as shown below. This is the file you need to point to when running
tw_gcal_sync
.
To specify your custom credentials JSON file use the --google-secret
flag as follows:
tw_gcal_sync -c "<calendar-name>" -t "<taskwarrior-tag>" --google-secret "<path/to/downloaded/json/file>"
Run the tw_gcal_sync
to synchronise the Google calendar of your choice with
the selected Taskwarrior tag(s). Run with --help
for the list of options.
# Sync the +remindme Taskwarrior tag with the calendar named "TW Reminders"
tw_gcal_sync --help
tw_gcal_sync -t remindme -c "TW Reminders"
Install the syncall
package from PyPI, enabling the google
and tw
extras:
pip3 install syncall[google,tw]
If the item was created from Taskwarrior then there should be a
status: pending
line in its description. Change it to status: done
or
status: completed
.
How do i modify the default event duration / How do I change the duration of a said event from Taskwarrior
syncall
is aware of the syncallduration
Taskwarrior
UDA
. This means you can assign a custom
duration to a Taskwarrior task using something like the following:
# create a task ...
# Make this a 15min task
task <id> mod syncallduration:15M
Then on subsequent runs, it will create an event of the said duration in Google Calendar.
You can also edit the default event duration using the
--default-event-duration-mins INTEGER
flag (specify it in minutes)
Note: To make it viewing the duration a bit more user friendly, e.g., for
Taskwarrior reports, the user can also add the following section to their
.taskrc
:
uda.syncallduration.type=duration
uda.syncallduration.label=GCal duration