Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RalfTheDog

macrumors 68020
Original poster
Feb 23, 2010
2,144
1,919
Lagrange Point
Hi, I hope this is not too political but I am having an annoying problem with my Studio Ultra. I have two HP 31.5 inch 4k monitors that are connected by USB C and one 31 inch LG 4k monitor that is connected by HDMI. The order for the two USB monitors keeps getting swapped around. Sometimes the one on the left swaps places with the one on the right. It just takes a few moments to fix with display preferences, but it is very annoying. Does anyone else have this problem? Better yet, does anyone else have the solution?

Thanks.
 

mi7chy

macrumors G4
Oct 24, 2014
10,622
11,294
Try playing around with this snippet of code although you might have to fine tune the logic.

https://stackoverflow.com/questions...-arrangement-through-command-line-applescript

Save the code as filename 'swap.c'.

Install Xcode command-line tools:

'xcode-select --install'

Then compile:

'clang -o swap -framework CoreGraphics swap.c'

Once you get it working the way you like you can set it as a login script by creating script 'swap.command' calling 'swap' then select it as 'Terminal shell script' in Users & Groups.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.