Google Calendar Integration Linux Script

To provide one way syncronization between google calendars events and Habitica Todos, you must install and configure [gcalccli] and [habitica cli].

gcalcli --military --nocolor agenda `date -d"+1 day" +%Y-%m-%d` `date -d"+2 day" +%Y-%m-%d` | awk -r '/^ +[0-9]+?:[0-9]+? / {printf "[CAL] "$1;$1=""; print $0}' | sort -r | xargs -tI% sh -c "habitica todos | fgrep '%' || habitica todos add --difficulty=easy '%'"

The script can be downloaded from [pastebin page]

The script goes in your calendar, and loads all non-Dailies for tommorow.

After that, for every event, script check if the event exists in habitica todos list. If not, add a new Todo to Habitica list with name "[CAL] %H:%M Event name" with easy difficulty.

For example, you create google calendar event "Learn more about Inferno and Plan9" at 15:00. After running this script, you will have a new Todo in Habitica titled "[CAL] 15:00 Learn more about Interno and Plan9"