I just wrote a simple program that can control the brightness and power state of the official touchscreen display. I though it might come handy if you need a simple interface for controlling such stuff.
https://github.com/jakeh12/rpi-backlight
COMPLETE FUNCTIONALITY ON DISPLAY BOARDS V2.0 AND V1.1 ONLY!
DISPLAY BOARD V1.0 ONLY "on" AND "off" WORKING (need to verify)
DO NOT FORGET TO READ USEFUL INFO ON BRIGHTNESS KEYBOARD MAPPING BELOW
Make sure you have git installed:
(Raspbian)
Code: Select all
sudo apt-get install git
Code: Select all
sudo pacman -S git
Code: Select all
git clone https://github.com/jakeh12/rpi-backlight.git
cd rpi-backlight
make
sudo make install
Code: Select all
sudo su -c 'echo SUBSYSTEM==\"backlight\", RUN+=\"/bin/chmod 0666 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power\" > /etc/udev/rules.d/99-backlight.rules'
sudo reboot
Code: Select all
rpi-backlight [option]
up: increases brightness by 10%
down: decreases brightness by 10%
max: sets brightness to 100%
min: sets brightness to 0%
on: turns the screen on
off: turns the screen off
Edit .xbindkeysrc in your ~/
Code: Select all
touch .xbindkeysrc
nano .xbindkeysrc
Code: Select all
# Increase backlight
"rpi-backlight up"
XF86MonBrightnessUp
# Decrease backlight
"rpi-backlight down"
XF86MonBrightnessDown
Code: Select all
# Increase backlight
"rpi-backlight up"
m:0x0 + c:233
# Decrease backlight
"rpi-backlight down"
m:0x0 + c:232
Code: Select all
xbindkeys
Hint: You can map the brightness to any key. Find out the key code by running
Code: Select all
xbindkeys -k
RPi 3 and Display Board V2.0 currents (RPi 3 running Arch with LXDE, idling):

Feel free to leave any comments or suggestions.
Jake