I want to change my display settings from "Extended Display" to "Main Display" with a keyboard shortcut. Is there a way to do this programmatically? You can press cmd+F1
to toggle the Mirror settings, but I haven't found a way to toggle the extended display function.
I think your best bet is probably displayplacer, which you can install via Homebrew (or probably MacPorts), or directly from the site. You can then do things via the shell (or a Keyboard Maestro shell script action) to change the displays.
You'd set the origin
of the display you wanted to be the main display as 0,0
, which macOS will then interpret as the main display.
I used to use this when I used my laptop as my primary Mac some years ago, but I haven't tried it recently ... but I think it'll do what you want, and more easily than GUI scripting.
-rob.
2 Likes
Plenty of "A" but not so much "I" in that last post...