screenresolution
screenresolution copied to clipboard
Does not list / use HIDPI resolutions
On a MacBook with a Retina display, resolutions with hi-dpi are not listed and seemingly not accessible. For example:
$ ./screenresolution list
2014-08-05 15:33:43.994 screenresolution[13007:507] starting screenresolution argv=./screenresolution list
Available Modes on Display 0
640x 480x32@0 1024x 768x32@0 1440x 900x32@0
800x 600x32@0 1152x 720x32@0 1650x1050x32@0
840x 524x32@0 1280x 800x32@0 2048x1280x32@0
1024x 768x32@0
$ ./screenresolution get
2014-08-05 15:33:48.503 screenresolution[13010:507] starting screenresolution argv=./screenresolution get
2014-08-05 15:33:48.509 screenresolution[13010:507] Display 0: 1280x800x32@0
$ ./screenresolution set 1280x800x32@0
2014-08-05 15:34:03.217 screenresolution[13012:507] starting screenresolution argv=./screenresolution set 1280x800x32@0
2014-08-05 15:34:03.223 screenresolution[13012:507] set mode on display 0 to 1280x800x32@0
$ ./screenresolution get
2014-08-05 15:34:07.031 screenresolution[13017:507] starting screenresolution argv=./screenresolution get
2014-08-05 15:34:07.037 screenresolution[13017:507] Display 0: 1280x800x32@0
While this may look perfectly fine, the original resolution was 1280x800 with HIDPI, and after the set
command, the resolution changed to 1280x800 without HIDPI.
I have some coding experience, and access to such a macbook, so with a little guidance I can probably help in developing / testing any changes.
Yes, please add ability to switch to HiDPI resolutions
:+1:
I did some hacking of get mode to report the number of pixels in addition to the logical resolution:
$ ./screenresolution get
2016-12-16 11:04:17.871 screenresolution[26642:545489] starting screenresolution argv=./screenresolution get
2016-12-16 11:04:17.875 screenresolution[26642:545489] Display 0: 1440x900x32@0 [2880x1800 pixels]
The relevant code fragment:
NSLog(CFSTR("Display %d: %ux%ux%u@%.0f [%ux%u pixels]"),
displayNum,
CGDisplayModeGetWidth(currentMode),
CGDisplayModeGetHeight(currentMode),
bitDepth(currentMode),
CGDisplayModeGetRefreshRate(currentMode),
CGDisplayModeGetPixelWidth(currentMode),
CGDisplayModeGetPixelHeight(currentMode));
Hi!
Looking around for a solution to this, I found pull request #21 that, after some "digging", led me to https://github.com/avibrazil/RDM -- which is a project that seems to be based on this, that actually provides a command line utility and a GUI one, and supports Retina displays. It seems to do what I was looking for...
So take this as a FYI
Hello everyone 👋🏼
Unfortunately in the meantime RDM was archived by the owner.
What is currently the best solution to programmatically change display resolutions including support for HiDPI (Retina) resolutions?