gcalcli icon indicating copy to clipboard operation
gcalcli copied to clipboard

Feature: Find next appointment called X

Open beardedfool opened this issue 6 years ago • 2 comments

Hi, new to this so sorry if this is obvious but I'm trying to find out how to get the next appointment called X please? Purely from bash.

The end result is that I can set a mostly regular event, say 'Wake' and script from that. With it automatically updating if I decide I'm planning in a later meeting that day.

Many thanks,

beardedfool avatar Oct 08 '19 23:10 beardedfool

gcalcli wraps google's search functionality which is part of the calendar api. So in general, you can run gcalcli search wake and parse the output. See gcalcli search --help for some ways you can constrain the search. If you know that the even you want is coming up at some particular time, you could parse the output of agenda.

In either case, if a script is reading the output of gcalcli, you may want to use --tsv since that will make the output easier to parse.

I hope this helps, if you provide more details I may be able to advise further.

jcrowgey avatar Oct 09 '19 17:10 jcrowgey

Ahh, you're a star! Am I looking in the wrong place for arguments, man page doesn't show --tsv?

gcalcli search --help Gives
Provides case insenstive search for calendar events. positional arguments: text start end

So I can search today tomorrow

I'll have another read of the man pages but, if you use days for start/ stop position, what time of the day does gcalcli use for both the start and end positions? I'm not sure that's clear so, in my head (a weird place) gcalcli search | today <-- start position picks the start of today e.g. 12 midnight at start of day today <-- end position picks the end of today e.g. 12 midnight at end of day

but gcalcli search today today actually gives no events found

Thank you so much for writing this, it's going to make a huge difference!

beardedfool avatar Oct 09 '19 19:10 beardedfool