I want to be able to toggle display mirroring on and off. I did a search here and saw a reference to a command line tool to do this but when I run this tool (command or it's corresponding app) it is only able to turn mirroring off. It won't turn mirroring back on. I suppose a change in Catalina has broken the tool (last update looks to be 2 years ago). I ran the code in Xcode and took a look but not being a macOS programmer it isn't clear what has changed that breaks the check for the current state of mirroring. Apparently Command-F1 used to toggle mirroring as well but on my system it doesn't work and in the Keyboard Shortcuts preferences there is no listing for mirroring. Anyway since I haven't found another solution...
I know how to open the Display preferences panel but I don't know of a reliable way to switch to the Arrangements tab and to toggle the checkbox using KM. Has anyone created something like this? TIA!