Repository navigation
Make unsupported resoltution + high refresh rate combo with HDR persist after screen sleeps #4986
Description
Activity
This is a complicated one as a sequence of events must take place which is better served by scripting it (using the app's CLI feature). You can then configure this script to run on wake. Nevertheless I tag this as an enhancement request and see if there are others who express interest in this feature.
- changed the title
[-]120hz HDR would not persist after screen sleeps[/-][+]Make unsupported resoltution + high refresh rate combo with HDR persist after screen sleeps[/+]on Jan 6, 2026 This is a complicated one as a sequence of events must take place which is better served by scripting it (using the app's CLI feature). You can then configure this script to run on wake. Nevertheless I tag this as an enhancement request and see if there are others who express interest in this feature.
How can it be done through the app's cli? I tried to run the following command, but it just puts me back to sdr mode after setting to 120Hz:
/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay set -nameLike=OLED -refreshRate=60Hz
/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay set -nameLike=OLED -hdr=on
/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay set -nameLike=OLED -refreshRate=120Hz
It is best to direclty switch the connection mode to the right one.
Get the list using this:
/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay get -connectionModeListAllthen switch using this (with the right id):
/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay set -connectionMode=[id]Thanks, I tested and that works great! I've pinned it to my menu bar. Is it possible to automatically trigger this shell command when the external monitor wakes up?
It is best to direclty switch the connection mode to the right one.
Get the list using this:
/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay get -connectionModeListAllthen switch using this (with the right id):
/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay set -connectionMode=[id]Thank you, it works! But there's a weird bug. When I run this command to change from 60hz sdr/hdr -> 120hz hdr, everything works fine. However if I run this from 120hz sdr -> 120hz hdr, the brightness of the screen is off. It's weirdly very bright, and the brightness control does not work unless < 50%. Seems like there's some weird bug affecting the brightness control?
Yes, the display needs to be in the proper HDR mode (60Hz) first for this to work.
For anyone who sees this later, here's my setup to automatically turn on scaled 4k (2816 x 1584) 120Hz HDR on M1 pro Macbook pro 16 inch every time the external display connects or wakes. It uses Hammerspoon to monitor the wake/connect events and use waydabber's command to turn on hdr at 120Hz.
Steps:
- Confirm that the command in this thread above works for you to enable 120hz scaled 4k HDR, then you can use Hammerspoon to automate the change
- Install Hammerspoon:
brew install --cask hammerspoon, you can probably also download the installation file from their website - open Hammerspoon config and paste this into the config, make sure to change the monitor name and connection mode as shown earlier this this thread.
local myMonitorName = "MAG321CU OLED" -- Exact name from your screenshot local myCommand = "/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay set -nameLike='MAG321CU OLED' -connectionMode=1949777125055401728" -- 2. THE ACTION FUNCTION -- We define this once so both watchers can use it local function applyMonitorSettings() local targetScreen = hs.screen.find(myMonitorName) if (targetScreen) then print("Target Monitor Found: Applying Settings...") hs.execute(myCommand, true) else print("Target Monitor NOT found. Doing nothing.") end end -- 3. WATCHER A: Detect Screen Wake (Wiggle Mouse / Open Lid) local wakeWatcher = hs.caffeinate.watcher.new(function(eventType) if (eventType == hs.caffeinate.watcher.screensDidWake) then applyMonitorSettings() end end) wakeWatcher:start() -- 4. WATCHER B: Detect Plug/Unplug (Layout Changes) local screenWatcher = hs.screen.watcher.new(function() print("Display Layout Changed (Plug/Unplug detected)") -- IMPORTANT: Wait 3 seconds to let the monitor 'settle' after plugging in -- hs.timer.doAfter(1, applyMonitorSettings) applyMonitorSettings() end) screenWatcher:start()- Reload the config in Hammerspoon, and DONE.
Reacted by BaileCliste and Dmytro MerkulovReacted by waydabberVery nice solution, congratulations!
Reacted by MartianI have a similar problem
I have a monitor that does 4k + 240hz + HDR on macos by default.
But 4k resolution is not comfortable. I would prefer a different resolution (eg 3008x1692 from betterdisplay's resolution slider is great)
I can get macos to do 3008x1692 highdpi + 240hz after unlock but not HDRUsing the trick of setting to 60hz and then shift clicking refresh rate works but would like an automated solution
martian009's script selects from one of the connectionModes but the settings I want do not appear there.
How best to achieve this in an automated way?
The script should work fine, but the connection mode ID is unique. You need to list it on your system and update the script to have the proper mode id.
/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay get -connectionModeListAllI get that but I mean the 3008x1692 resolution I want is not listed in the connection mode list.
But it is available in the slider in Better Display
Oh, but 3008x1692 is not a timing but a scaled resolution. You should look for a timing/mode line with the native resolution of your display.
I'm not sure if I'm misunderstanding you or you're misunderstanding me haha
I'll try break it downThe native resolution of my monitor is 4k. In macos settings I can enable 4k, 240hz, and HDR (without using BetterDisplay). Just Display Settings in the OS settings.
This config (4k, 240hz, HDR) is listed when I run this command
/Applications/BetterDisplay.app/Contents/MacOS/BetterDisplay get -connectionModeListAllI assume it is this one:
2026057461682409216 - 3840x2160 240.02Hz Fixed 10bit HDR10 RGB Full P3 (7680x4320)However, I don't want this. I want 3008x1692, 240hz and HDR to be my default settings each time I login/unlock
I can enable this new config in BetterDisplay by first loading (3008x1692, 60hz, HDR) in macos display settings and then Shift clicking refresh rate in BetterDisplay and choosing 240hz.But it is lost after lock/unlock. I can only get one of these by default after unlock
- 3008x1692 and 240hz but not HDR
- 3008x1692, 60hz, and HDR.
So my question is how to achieve (3008x1692, 240hz and HDR) with an automated script.
Thanks for the help!
I understand, however 3008x1692 is a scaled resolution - the Mac outputs scaled resolutions at the currently configured native resolution (if it's a 4K display, then 4K). The connection mode list you see is not the traditional display mode list (you can get that using
get -displayModeList), but actual timing and color mode combinations that are deemed viable based on the EDID and link configuration. That's why you need to select a proper connection mode that matches to the underlying output resolution of the scaled listed display mode (3008x1692) you have.Reacted by BaileClisteAh I understand you now and you are correct. I assumed that either one of macos display settings or BetterDisplay would show that all 3 (resolution/refresh rate/hdr) settings I care about are set after I run the command. Neither shows HDR as enabled. However, after running the command I can see in my monitor OSD that HDR is actually enabled.
So I have it all working now with martian's script now and the right ID.
Thank you both. I bought BetterDisplay Pro :)
Reacted by waydabber

When trying to bypass Apple limitation and set 120hz HDR on my 4k monitor, this works (#2567) but the setting won't stick. If the display sleeps and wakes up again, it's back in SDR not in HDR mode. Any idea how to make it stick? I purchased the pro version to use the configuration protection, but it doesn't do anything. Still goes back to SDR after display sleeps. Also tried to turn on Reinitialize this display on wake/unlock, same issue. Is there a way to add a feature and make this 120hz HDR setting stick in BetterDisplay?