Here’s my approach using Templator. I have this integrated with the Day Planner plugin in Command mode. Omit the Day Planner bit if it doesn’t apply.
-
I create a user command in Templater Settings:
gcalcli :/usr/local/bin/gcalcli --calendar <work-calendar> --nocolor agenda 12am 11pm | tail -n +3 -
I add this in my Daily Notes template below the ## Day Planner heading
<%*
let agenda = await tp.user.gcalcli()
let split = agenda.split("\n")
tR += split.map(i => {
const date = i.match(/([0-9]*\:[0-9]*)\s/gi)
const event = i.match(/(\[\[)?[A-Z].*/gi)
if (date && event) {
return `- [ ] ${date} ${event}`
}
}).join('\n')
%>
<%* app.commands.executeCommandById("obsidian-day-planner:app:link-day-planner-to-note") %>
Output Looks like:
- [ ] 09:30 Morning Centering
- [ ] 11:00 Morning Dog Walk
- [ ] 11:30 Fika! [T/Th]
- [ ] 11:40 Book Club