OK, having mixed luck.
I think the basic structure of what we’re looking for would be like this:
-You have to create time-based automations that run every 30 minutes on the 25/55 minute mark (because I don’t think you can set something to run repeatedly during the day in Automations)
-Automation runs a shortcut that searches for event starting in the next 5 minutes
—Probably need an “if” statement there in case there is no event, in which case the Shortcut terminates.
-If there is an event and it has the Focus type in the title, it will grab that focus type and set it as the variable “Focus”
-The shortcut uses that variable to run the shortcuts scripting action “Turn Focus On”
In my quick and dirty attempt to create this, I can’t get the variable grabbed from the calendar event to become the Focus Type in the Turn On Focus action. I’m sure this is possible but I am missing something.
Another note, you’d have to create a calendar template that contains the type of focus you want turned on. That’s also not insurmountable. I
I feel like this is attainable but need to play around some more. I may also post this over in the Shortcuts area in Reddit and in the Automators Talk forum to see if any one has ideas on this.