As described here, MacOS has a nasty habbit of resuming sleep or booting up with external monitors swapped in between when using multiple identical monitors.
Using DisplayPlacer and help from the community, we can configure a BetterTouchTool keyboard shortcut (or other shortcuts) to swap them in their proper place when they bootup in the incorrect order.
- Install DisplayPlacer by running this in your terminal (requires Homebrew)
brew tap jakehilborn/jakehilborn && brew install displayplacer
- In BetterTouchTool, create a new Keyboard shortcut, i.e. Opt + Shift + S
- Select
Execute Shell Script
as an Action - Paste the following script as a bash script and Save
/opt/homebrew/bin/displayplacer list | tail -n1 | sed 's/displayplacer //;s/id:\(.\{36\}\) res:\([0-9x]\{7,9\}\) \(.*\)id:\(.\{36\}\) res:\2/id:\4 res:\2 \3id:\1 res:\2/g' | xargs /opt/homebrew/bin/displayplacer
- Profit!