Hello All!
My setup is a dual setup: Two identical Samsung monitors, one connected thru USB-C and the other through HDMI, and the same described behavior, some times it wakes up as desired, but other times all messed up. I'm pretty sure it does not have to do with the Mission Control settings since it has to do with the spaces, not the desktop placement.
This is my current workaround if it is helpful to anybody: I read that the suggested application "Stay" does not work, so it was not an option.
So I kept reading the thread, and there was a mention of an application called
displayplacer that caught my eye. Here is the GitHub
link, but if you are lazy and don't want to read the whole ReadMe, here is the installation command with brew:
Bash:
brew tap jakehilborn/jakehilborn && brew install displayplacer
Once installed, setup your desk like you want/need and run the following command:
At the very bottom of the output is the command to "set" the display positions as they are when you run the command. My command is the following:
Bash:
displayplacer "id:42A05AE1-8F6E-443D-AB32-85EB80A747A7 res:1920x1080 hz:75 color_depth:8 scaling:off origin:(0,0) degree:0" "id:BF0612DA-F98B-44AC-B500-06C7350727C8 res:1920x1080 hz:75 color_depth:8 scaling:off origin:(1920,0) degree:0"
So you can scramble the displays again and test the command, and it should go back as intended. If that works, the rest is straightforward: create a script to run that command.
At this point, I had two options: Automator or Shortcuts; I decided on the latter since it was more UI friendly and had more info to set up. So, I created a shortcut, "Run Shell Script," and assigned a keyboard shortcut.
It complains about not finding the
displayplacer program, so I ran
whereis displayplacer in the terminal, and it told me that it was located at /opt/homebrew/bin, so I added that at the beginning of the Shell Script, and it looks like:
Bash:
/opt/homebrew/bin/displayplacer "id:42A05AE1-8F6E-443D-AB32-85EB80A747A7 res:1920x1080 hz:75 color_depth:8 scaling:off origin:(0,0) degree:0" "id:BF0612DA-F98B-44AC-B500-06C7350727C8 res:1920x1080 hz:75 color_depth:8 scaling:off origin:(1920,0) degree:0"
This time it worked, so now, if everything is messed up when the computer resumes, I just hit that shortcut, and everything gets fixed!
Success? Not yet. When it went to sleep and woke up, everything was messed up again, and running the command didn't seem to work this time. So I switch the "origin" parameters on the scripts, so the other monitor has 0,0 and the second 1920,0. Run that script, and now it works.
So, the issue now is that I have two possible commands to fix this issue. And again two options: create another shortcut for that o make the "Shortcut" script smarter. And, of course, I choose the latter.
Since I have two scripts, I modified the Shortcut to prompt me with a message asking if the first command did not fix the issue to try the second command ("Cancel" will stop the Shortcut and not run the second command), and sure enough, now the shortcut works for both scenarios. I can hit a combination of keys on my keyboard, or I can run it from the MenuBar, so it is not perfect, but at least I don't have to go all the way to settings and rearrange everything every time the computer decides to act up.
It's not optimal, but it is a simple workaround that works for me. The same can be done for three displays, just more alerts involved.
Attached is what the Shortcut looks like.