qsrc
Posts: 7
Joined: Tue Oct 04, 2016 8:39 pm

Touch-triggered display dimming

Tue Jan 14, 2020 7:29 am

I have a (non-official) capacitive-touch display interfaced to a CM3+ via dpi24. It works fine; display dimming via PWM works fine as well. What I would like is to have the display auto-dim if it hasn't been touched for some time (say, a minute), and brighten to the preset brightness when it is touched again. Is there any built-in kernel infrastructure to support this functionality? I'm running 4.9.58.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2584
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Touch-triggered display dimming

Tue Jan 14, 2020 8:49 am

I'm not aware of a kernel feature like that - it sounds more like a screen saver configuration option, i.e. up in userland at the desktop or application level.

MikeDK
Posts: 86
Joined: Thu Mar 19, 2015 12:01 pm

Re: Touch-triggered display dimming

Wed Feb 05, 2020 11:01 am

I agree with PhilE, you can achieve this for X via the xset utility.
Precondition is a working backlight sysfs node ... look into /sys/class/backlight if there is some node (but I guess so, as you write you can dim your display fine)

I have a similar setup - a touch display where the backlight shall be switched off completely after some time.

I use following command to setup a screen blanking after 1 minute timeout:

Code: Select all

xset s 60 60
or, if you like to do it over ssh...:

Code: Select all

DISPLAY=:0.0 xset s 60 60
After 60 seconds, the screen turns blank ... If i touch the display, it gets lit again.

Now, for your setup, you probably have to setup xscreensaver. I bet there is at least one screensaver which dims the screen to some defined value.
Activate that, and then run the command I wrote above ... theoretically, it should then dim after 60 seconds.

Hope that helps.

Regards,
MikeDK

User avatar
Laguna
Posts: 4
Joined: Mon Jun 17, 2019 11:44 am

Re: Touch-triggered display dimming

Mon Feb 10, 2020 2:37 pm

Is there any built-in kernel infrastructure to support this functionality.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2584
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Touch-triggered display dimming

Mon Feb 10, 2020 2:40 pm

I think I answered that already:
I'm not aware of a kernel feature like that - it sounds more like a screen saver configuration option, i.e. up in userland at the desktop or application level.
You'll have to elaborate on your question a bit if that didn't cover it.

Return to “Device Tree”