Closed mlmatlock closed 2 months ago
Ha! Amazing nobody has ever run into this before, since that's been in there since 0.2. Thanks for the report.
I'm open to suggestions. Dianne fixed in the distributed version by hardcoding +15
Hi, Justin et al...
I think hard-coding 15 is not ideal. If ical has a way to represent an advance warning timeout, we should probably take it from the ical input. Otherwise, perhaps a command-line option to add either "+n" or "SCHED _sfun" could be used? Something like:
--advance-warning=15
or
--sched-fun=_sfun
when you invoke ical2rem.pl.
Since a calendar entry can have multiple notifications, it's handled with a VALARM subentry
BEGIN:VALARM ACTION:DISPLAY TRIGGER:-P0DT1H0M0S DESCRIPTION:This is an event reminder END:VALARM
But that really isn't an idea supported by remind, since to have multiple notifications, you have to have a sched function. I do notice that while there is a warning, at least it does have a decent fail mode:
"If an error occurs during the evaluation of sched_func, then Remind reverts to using the AT time and the delta and repeat values, and never calls sched_func again."
So I can really see a few ways to handle.
I'm kinda leaning toward #1. That's definitely easiest :-)
other options?
I admit that I'm not familiar with ical, but isn't the usual case that a reminder has a single advance warning? I know when I add something on my phone, by default it warns me 30 minutes in advance and I just accept that.
So if there's only one VALARM, can't we just add a "+N" corresponding to the amount of warning it requests? And if there's more than one VALARM, just pick the earliest and don't worry about the rest? EDIT: that was basically your #3.
I would lean to #1 as well. I really depend more on my phone/iPad notifications, especially if I'm not at my computer for a trigger time.
Oh hey, another thing you could do is have ical2rem.pl
emit a header something like this:
IF args("_sfun") < 1
FSET _sfun(x) choose(x, -60, 30, 5, 0)
ENDIF
which would use your definition of _sfun
unless the user had already defined their own version.
Oh that's a great idea. I'll take door Number 4 :-)
I'm just using
IF args("_sfun") < 1
FSET _func(x) choose(x,0)
ENDIF
so if no functions is defined, no reminders are set.
@jbalcorn, thank you!!!
Downloading and converting my G-Cal, I get this:
REM Sep 5 2024 +3 AT 09:00 SCHED _sfun DURATION 1:00 MSG %a %2 %"Audiologist%"%
When starting remind/Tkremind, I get this:
/home/xxxxx/.config/remind/gcal_full.rem(5): Undefined SCHED function: `_sfun'
Still prints ok (for now).