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've yet to verify 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, removed 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 --gcal-secret
flag as follows:
tw_gcal_sync -c "<calendar-name>" -t "<taskwarrior-tag>" --gcal-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 taskwarrior-syncall
package from PyPI, enabling the gcal
extra:
pip3 install taskwarrior-syncall[gcal]
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
.