you can create such a trigger for specific monitors using conditional activation groups.
1.) Create a new conditional activation group and use the activeScreenResolutions to check whether your external screen is connected
2.) Then in the "Automations, Named & Other Triggers" use the "Conditional Activation Group Activated" trigger: