I've done a lot of Googling but not found anything. What I would like to do is dim the backlighting after a timeout period of no GUI activity and restore the backlight brightness on GUI activity. Rather like a screensaver image appearing but instead dimming the backlighting. I've seen it done but don't know how to implement it without writing something from scratch. Pi 3B+ and Official Touchscreen (New Version) - Any Ideas? Thanks
Starting with Pi Touchscreen Timeout I've hacked that code to not just set bl_power to 0 or 1. But to progressively changed the brightness (/sys/class/backlight/rpi_backlight/brightness) from the current value down to zero.
On a touch event the brightness is set back to the initial value.
You can get my code from backlight dimmer on Github.
With the assistance from this Forum, specifically Dougie I have a solution to my original question and this allows the Raspberry Pi Touchscreen to be dimmed (or completely off) gradually after a timeout period to allow a longer life to the backlight and also save power. The brightness is restored on a touch of the screen. This is available and documented here pi-touchscreen-dimmer.git
Hopefully, others will find this useful.