3

Mac n00b here. I'm running an iMac (OS X 10.10.4) with a projector attached as secondary display (extended desktop) and I have to set the position of this secondary screen in a way that the two screens align exactly at the center. My primary screen is of resolution 5120x2880, my secondary of 1920x1200, so I would have to place the latter at exactly 5120/840.

Doing this using the GUI in Displays -> Alignment seems to be next to impossible, since there is no snapping at the center. Now I'm thinking, is it possible to to this via scripting somehow? Or by editing some screen setup config files?

Thanks much!

  • To be sure I understand, you want to automate the dragging of the proxy rectangles within the Displays macOS preference pane where you arrange the relative position and alignment of both displays? – bmike Aug 19 '16 at 11:17
  • Yes. Well, I don't want to drag them at all, I just want to do the positioning via script (or similar), so I don't have to use the GUI for this, since it doesn't seem to be accurate enough for my requirements. I remember the possibility in Ubuntu to place a configuration file containing my screen layout coordinates somewhere on disc, I don't know if there is anything comparable on OS X, but this would also help me a lot. – iko79 Aug 19 '16 at 11:24
  • Yes - the system will surely write the configuration to somewhere on the filesystem. I might need to find time to do work to trace where the file is written. If you wanted to try fs_usage -w would let you know what files are written the moment you make a change to the preference... – bmike Aug 20 '16 at 1:07
  • Thanks for pointing me to fs_usage, that's actually quite useful. However, I wasn't able to find anything suspicious. The only line catching my attention is this one: 11:02:34.363524 open F=4 (RW____) /Library/Preferences/com.apple.windowserver.plist.e1SCetv 0.000008 cfprefsd.18451. Turns out there is no such file; but I'm able to find a file called "com.apple.windowserver.plist", but it's binary. Are there any options of using scripting or some tools to achieve what I want to do? – iko79 Aug 22 '16 at 9:54
1

osx-display-positioner is a command line tool which lets you save and restore the position of multiple displays. The description of the tool doesn't discuss using it to set the display position, but if the settings file is readable and editable, you might be able to use it to accomplish your goal.

  • That is exactly what I was looking for, thanks a ton! – iko79 Aug 25 '16 at 10:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .