This question is not about how to fix my system to work as it should. If you want to answer that question, see my prior question.
In order to get my three monitor system to work I have to physically unplug the monitor that is not working, plug it back in, and then do that again. This is inconvenient if not physically damaging my HDMI connector.
Therefore I'd like to execute a program that is the equivalent of what the system does when it detects a monitor has been disconnected and the equivalent program for what the system does when it detects a monitor has been connected. Preferably of course they would be the same program but perhaps with a different parameter corresponding to "disconnect" and "connect" or some such.