I use SecondBar to add a menu bar to an external display. I've added it to my login items, but I don't want it to open when there isn't an external display. How do I open SecondBar when a secondary monitor is connected?
Take a look at the free/open source app ControlPlane.
You can trigger different actions based on context-sensitive rules, including launching an app in response to connecting a display.
There is no way of automatically doing it with out modifying the operating system, as the display is managed as a core process. The best is just to put a shortcut on your desktop and open it when you are plugging in a display