displayplacer: error rotating screen on M1 with Ventura
I’m on an M1 MacBook Pro running Ventura 13.0.1, with two external displays. Got the same error when I ran it from the brew install, and when i made the latest source (except for the extra enabled:true field).
I first tried displayplacer list after setting my display to 0" and 90" using System Settings. The last line of the output included this for 0:
"id:8E291BE3-E0C5-4282-9EFB-57B0F5311B8F res:1920x1080 hz:60 color_depth:8 enabled:true scaling:off origin:(-1080,840) degree:0"
and this for 90:
"id:8E291BE3-E0C5-4282-9EFB-57B0F5311B8F res:1080x1920 hz:60 color_depth:8 enabled:true scaling:off origin:(-1080,840) degree:90"
If I try to run displayplacer with either of those values, when the screen is rotated to the other value, I get an error like this:
Error rotating screen 8E291BE3-E0C5-4282-9EFB-57B0F5311B8F: (ipc/send) invalid destination port, code: 0x10000003
Screen ID 8E291BE3-E0C5-4282-9EFB-57B0F5311B8F: could not find res:1080x1920 hz:60 color_depth:8 scaling:off
and the screen doesn’t rotate. It does mess with the arrangement of the displays when I run this, so something is working…just not the rotation.
Possibly related: I also tried display_manager, which looks like it uses the same IOServiceRequestProbe call, and that also failed, with error code 268435459.
The only non-Apple solutions I’ve found that still work are Display Rotation Menu and BetterDisplay, but I don’t know what they’re calling.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 2
- Comments: 15 (4 by maintainers)
Here, this should do it I think. And it’s not M1 only, it should work as far back as 10.6. Amazing for a private api to remain so stable.
compile with
-fobjc-arc -framework MonitorPanel -F /System/Library/PrivateFrameworksProbably to make it cleaner you’d want to use the proper dumped structs as in https://github.com/alin23/mac-utils/blob/main/Headers/MonitorPanel.framework/Headers/CDStructures.h
In fact a lot of the above methods can be used in
displayplacerto do things at a higher level than CGS calls.setModeis really interesting, it allows you to control resolution, refresh rate, with, height, etc.One benefit of doing it via SLSSetDisplayRotation though is it can probably force orientation even when MonitorPanel frameworks thinks
canChangeOrientationis false. Even MBP internal screen hascanChangeOrientation = trueso I’m not sure what sort of displays would have it false. Maybe virtual displays like sidecar?Now I can replace two really messy AppleScript automations I had hacked together! (One for when running a single external display, the other when running dual displays) WOOOPP
Latest works a treat - amazing! Thanks @jakehilborn and @krackers!
I had an old version at that was taking priority on my PATH