Greetings.
Just got myself a really nice 1440p 27" monitor. Freesync and high refresh rate works straight out of the box.
Now playing with the HDR settings. Love that the display settings have that checkbox to enable it.
Although I don’t like having HDR turned on all the time as I also want to use a proper ICC profile when working on other stuff. HDR works great in movies and games but get too much otherwise.
So I switch between HDR off and on depending on what I’m doing.
I have a “special” script that I use with steam to activate overclocking, fan curves etc when a Steam title is launched. It also sets a power-efficient mode when out of a game back onto the desktop. That part works great.
I now had the idea of activating and deactivating HDR in this launcher-wrapper script of mine.
I looked into the command “kscreen-doctor” and found that it provides me with exactly what I want… or so I thought.
What I’m trying to do:
Activate HDR mode with:
kscreen-doctor output.DP-3.hdr.enable
(Yes. My primary IPS HDR screen sits on output DP-3)
This is where I run into a problem: The system attempts to apply HDR settings, but the screen does not activate the actual HDR mode. Everything becomes a grey-greenish mess. The monitor stays in regular SDR mode. It never switches over to HDR mode.
If I instead go through settings → display & monitor ->Enable HDR with the checkbox and hit “Apply”. The monitor starts HDR mode and the HDR applies correctly. (monitor turns off briefly to switch in and out of the HDR mode)
It would seem that kscreen-doctor does not activate HDR properly, while system settings do. They seem to do it differently from each other.
I hoped kscreen-doctor would apply the very same HDR settings as the System Settings would, but apparently, that isn’t the case.
My question: What other command can I use in a script to properly enable and disable HDR mode?
The “HDR” checkbox in the system settings also enables wide color gamut, that’s the difference. If you do
kscreen-doctor output.DP-3.hdr.enable output.DP-3.wcg.enable
it should work the same.
1 Like
This works.
Thanks. I suspected I had to enable/disable something else as well.
Now I can apply this to a toggle-script with a keyboard shortcut.
EDIT:
I do notice kscreen-doctor do some sort of a silent pause before applying anything. Hitting any key while it “pauses” makes it resuming what one tries to apply with it. A minor annoyance.
EDIT 2: (For the records)
I was not entirely right about the pausing I’m experiencing.
It’s more like that kscreen-doctor waits for the screen to have some activity on it. I suspect Freesync to be involved.
When I run:
kscreen-doctor output.DP-3.hdr.enable output.DP-3.wcg.enable
kscreen-doctor pauses indefinitely until something is updated on the screen in question. At that very moment Freesync goes down to 48Hz and nothing else happens (My monitor has a Hz counter one can activate).
But at the very moment something on the screen is redrawn, kscreen-doctor resumes and executes the commands it was given. Screen then flickers and switch over to HDR as intended.
My solution on this is simple. I’ll background kscreen-doctor and let the script continue no matter what kscreen-doctor does in the background.
Example:
# Due to a bug with kscreen-doctor, we need a delayed screen update. Otherwise it'll wait indefinetly on a screen update.
sleep .5 && notify-send 'HDR toggling' &
nohup kscreen-doctor output.DP-3.hdr.enable output.DP-3.wcg.enable >/dev/null 2>&1 &
# ... steam-related stuff goes here ... #
...
With this, kscreen-doctor waits in the background and since we’re continuing the script as intended, screen updates happens no matter what.
Solves the problem. A minor annoyance, but now I can forget about this script and have media and games activate and deactivate HDR on the fly. Just as intended.