Skip to content

Instantly share code, notes, and snippets.

@einsitang
Created December 19, 2024 08:35
Show Gist options
  • Save einsitang/b36b6238a01d7cfab2a073b1b131b202 to your computer and use it in GitHub Desktop.
Save einsitang/b36b6238a01d7cfab2a073b1b131b202 to your computer and use it in GitHub Desktop.
macos screen setting script
Install displayplacer
https://github.com/jakehilborn/displayplacer
Install via Homebrew with:
#> brew tap jakehilborn/jakehilborn && brew install displayplacer
If you don't have Homebrew installed, you can install displayplacer from their releases tab:
https://github.com/jakehilborn/displayplacer/releases
After the install is completed, set up your monitors how you would normally have them in your normal every day non-rotated arrangement, and then run the command:
#> displayplacer list
You should now see a long list of all your monitors and the modes they support, but at the bottom will be a displayplacer command that you would type to get the current monitor configuration. Copy this command as your rotate 0° command, and save it somewhere temporarily because we'll need this in the in just a minute. An example of the command follows:
#> displayplacer "id:D418A8103-511F-913F-97A2-6023AA77DD22 res:2560x1440 hz:60 color_depth:8 scaling:on origin:(0,0) degree:0" "id:B1D513F6-4BCF-C326-81E6-B9B5126C594B res:2560x1440 hz:60 color_depth:8 scaling:on origin:(2560,0) degree:0"
Now, rotate your desired monitor 90° and arrange how you would like through System Settings. Run the list command again:
#> displayplacer list
You should, once again, see a long list of all your monitors and the modes they support. Copy the command at the bottom as your rotate 90° command, and save it somewhere temporarily because we'll need this in just a minute. An example of the command follows:
#> displayplacer "id:D418A8103-511F-913F-97A2-6023AA77DD22 res:2560x1440 hz:60 color_depth:8 scaling:on origin:(0,0) degree:0" "id:B1D513F6-4BCF-C326-81E6-B9B5126C594B res:2560x1440 hz:60 color_depth:8 scaling:on origin:(2560,-274) degree:90"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment