Xfce Forum

Sub domains
 

You are not logged in.

#1 2025-03-28 21:00:29

Mo_B
Member
From: Germany
Registered: 2016-03-04
Posts: 62
LinuxFirefox 136.0

Adding DDC brightness control to Power Manager Plugin

Hi,

I would like to file a feature request to https://gitlab.xfce.org/xfce/xfce4-powe … r/-/issues
but first like to discuss this here.

On a laptop I often adjust the brightness to the current situation manually. This is done via the BrightnessUp and BrightnessDown key or alternatively by scroll wheel on the panel item. Good.

Now I often use a mobile additional HDMI screen and like to adjust that too without touching the hardware buttons. I found that it's possible via DDC. For instance ddcui or ddcutil.

I wrote a script for the up and down. It works, but they are slow for very small stepping. I thought it would be great to add such a feature to the Power Manager Plugin. I'm not even sure if other Window Managers tools are addressing DDC already.
Thinking further, I have a desktop installation with 3 screens via Displayport. I usually don't change their brightness but depending on the daytime it might be useful to switch all 3 screens simultaniously. As screens tend to not being identical the configuration would need a bias for each screen to define the same physical mid brightness, and individual step width.

What do you think? For now using a single mobile 2nd screen, I use these scripts, added as keyboard-shortcuts for Alt+Super+F3 and Alt+Super+F4 because the internal brightness control is fn+F3 and fn+F4.
I tried to create shortcuts like fn+Alt+F3, but this does not work as fn is not a keycode to the kernel but hardware-internal somehow...

brightness_up:

#!/usr/bin/env bash
conf_step=10
current=$(ddcutil getvcp 10 | sed -n 's/.*current value *= *\([0-9]\+\).*/\1/p')
new=$((current + $conf_step))
if [[ "$new" -gt 100 ]]; then new=100; fi
ddcutil --display 1 setvcp 10 $new
echo "Changed brightness from $current to $new"

brightness_down:

#!/usr/bin/env bash
conf_step=10
current=$(ddcutil getvcp 10 | sed -n 's/.*current value *= *\([0-9]\+\).*/\1/p')
new=$((current - $conf_step))
if [[ "$new" -lt 0 ]]; then new=0; fi
ddcutil --display 1 setvcp 10 $new
echo "Changed brightness from $current to $new"

Last edited by Mo_B (2025-03-28 21:09:34)


Gentoo-Linux

Offline

#2 2025-03-29 07:29:09

Tamaranch
Member
From: France
Registered: 2020-12-31
Posts: 358
Website
LinuxFirefox 136.0

Re: Adding DDC brightness control to Power Manager Plugin

Offline

#3 2025-03-29 07:51:03

Mo_B
Member
From: Germany
Registered: 2016-03-04
Posts: 62
AndroidChrome 134.0

Re: Adding DDC brightness control to Power Manager Plugin

Thanks, I did not remember where I've seen that already and commented some time ago
I have added my idea there.

Added later 15 h 34 min 46 s:
Further development here: https://github.com/Massimo-B/scripts/bl … brightness


Gentoo-Linux

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.007 seconds, 7 queries executed - Memory usage: 529.78 KiB (Peak: 531.06 KiB) ]