jakehilborn / displayplacer

macOS command line utility to configure multi-display resolutions and arrangements. Essentially XRandR for macOS.
MIT License
3.74k stars 134 forks source link

add json `list` output #141

Open noahcoad opened 1 month ago

noahcoad commented 1 month ago

Would be helpful to get displayplacer list output in json format to be able to more easily programmatically retrieve display parameters, such as id, current mode, resolution, etc

maximejobin commented 1 week ago

I totally agree. I'm making a script and the values also contain comments so it is not fun to manipulate.

For instance:

Origin: (0,0) - main display
Rotation: 0 - rotate internal screen example (may crash computer, but will be rotated after rebooting): `displayplacer "id:37D8832A-2D66-02CA-B9F7-8F30A301B230 degree:90"`

Should be:

Origin: (0,0)
Rotation: 0

Samething for:

 mode 2: res:1024x768 hz:60 color_depth:4 scaling:on <-- current mode

That should be:

 mode 2: res:1024x768 hz:60 color_depth:4 scaling:on

... with probably a mode value.

To make things easier for developers, please consider a JSON output.