How to programmatically change screen brightness for both internal and external display?

My problem
KDE used to be able to change my external display’s brightness until last month, then it stopped working, not sure why but it doesn’t matter. Even when it did work it wasn’t very useful because the same key would change the brightness for both my internal and external displays.

I want to just create a script for controlling the individual brightness for both my monitors. What tool does KDE use for doing it?

What I have tried
While I couldn’t find how KDE does things, I did find ddcutil -d 1 setvcp 10 + 10 which kinda solves my problem but it’s not a good solution. After binding this command to an unused key on my keyboard, holding it down makes my CPU usage spike untill my system stops responding. Hence, ddcutil is out.

Can someone tell me what KDE API can be used for this so I can just create a small script and bind it to the unused keys on my keyboard?

install gddccontrol and you can use the command line tool ddccontrol to change brightness among other things.

You can set all display settings, including brightness, with kscreen-doctor

2 Likes

Weird. I can control the brightness just fine with ddcutil… minus the CPU spikes.
kscreen-doctor -o

Output: 2 HDMI-A-2
        enabled
        connected
        priority 1
        ...
        Brightness control: unsupported