Live data from Hacker News

macOS CLI tool to configure multi-display resolutions and arrangements

github.com

21–30 of 88 posts

Re: macOS CLI tool to configure multi-display resolutions and arrangements

#21
post #20
post #15

Earlier quoted context omitted.

I published a CLI for doing rotation for any display here: https://github.com/alin23/mac-utils/blob/main/bin/RotateDisp... Source code in the same repo: https://github.com/alin23/mac-utils/blob/main/RotateDisplay.... As long as the system reports `true` for `canChangeOrientation`, then the CLI should work. Lunar ( https://lunar.fyi/ ) can also do that and provides some useful hotkeys if you happen to rotate displays…

Do any of these methods work to rotate a Sidecar display? Right now I’m using BetterDisplay to creat a dummy and then rotate and stream that dummy to the Sidecar display, but it’s a bit unwieldy and sometimes unreliable (due to an Apple bug apparently).

Unfortunately not, the system reports false for canChangeOrientation on a Sidecar display:

    mac-utils  ./bin/RotateDisplay sidecar 0
    ID  UUID                                Can Change Orientation  Orientation Name
    1   37D8832A-2D66-02CA-B9F7-8F30A301B230    true                    0°          Built-in Liquid Retina XDR Display
    6   BF8D0007-9573-49E5-8130-75991ECB2F15    false                   0°          Sidecar
    4   FB46E28E-5B98-475A-A610-C15237238C8D    true                    0°          LG Ultra HD

    The display does not support changing orientation: Sidecar [ID: 6]

Re: macOS CLI tool to configure multi-display resolutions and arrangements

#24

Would love if these tools also had the ability to save application window settings too.

This is what I’m looking for too. I have three places I plug in displays: home office, work office, no displays (coffee shop). I have specific windows I want in specific places when plugged into external displays at home or work. Browser, Remote Desktop tool, chat client, etc. Every time I come back from the coffee shop, I have to manually re-arrange my windows. First world problem I know but every time I think “it should be smart enough to land these windows in this spot”

Similar with code editors: it should be smart enough to re-arrange my docks based on screen size. When I have big screen, expand side and bottom sub-windows. When I’m just on laptop screen, auto hide them.

Re: macOS CLI tool to configure multi-display resolutions and arrangements

#25
post #21
post #20

Earlier quoted context omitted.

Do any of these methods work to rotate a Sidecar display? Right now I’m using BetterDisplay to creat a dummy and then rotate and stream that dummy to the Sidecar display, but it’s a bit unwieldy and sometimes unreliable (due to an Apple bug apparently).

Unfortunately not, the system reports false for canChangeOrientation on a Sidecar display: mac-utils ./bin/RotateDisplay sidecar 0 ID UUID Can Change Orientation Orientation Name 1 37D8832A-2D66-02CA-B9F7-8F30A301B230 true 0° Built-in Liquid Retina XDR Display 6 BF8D0007-9573-49E5-8130-75991ECB2F15 false 0° Sidecar 4 FB46E28E-5B98-475A-A610-C15237238C8D true 0° LG Ultra HD The display does not support changing orient…

I see… Thanks for confirming!

Re: macOS CLI tool to configure multi-display resolutions and arrangements

#26
The problem that I have with my M1 is that I have 2 HP monitors with USB-C connectors and when I plug the USB/C Thunderbolt cable in to the monitor, often its not recognized and I often need to power off the machine, the monitor and or switch the ports in some combination, I really wish I could just have a manual probe I could run reliably to tell macOS,the monitor that they are connected. Any ideas?

Re: macOS CLI tool to configure multi-display resolutions and arrangements

#28
post #22

Related to this does anyone know a way to turn off displays in MacOS? I have 2 screens connected to an M1 Mac Mini.

Lunar's BlackOut feature can do that: https://lunar.fyi/pro#blackout

The feature is especially useful if you want to turn them off in software and keep them still connected to the Mac so that you can turn them on at a later time using a hotkey for example.

If you simply want to turn them off completely, just like you would press the physical power button of the monitor, then Lunar can do that by sending a DDC toggle power command, but there are some caveats to be aware of:

    works only if the monitor can be controlled through DDC (most monitors work)
    can't be used to power on the monitor
    when a monitor is turned off or in standby, it does not accept any commands from a connected device
I recently wrote a deep dive into how I tried to find a better way to turn off these screens using private macOS APIs: https://alinpanaitiu.com/blog/turn-off-macbook-display-clams...

Re: macOS CLI tool to configure multi-display resolutions and arrangements

#29
I have used cscreen [1][2] for a while to switch resolutions beyond what macOS offers via its GUI. You can install it via `brew install cscreen`.

It seems like displayplacer is the spiritual and de facto successor to screen. [3]

[1] https://www.pyehouse.com/cscreen/#comments [2] https://apple.stackexchange.com/a/73696 [3] https://apple.stackexchange.com/a/173875

Post reply on HN