Re: Lenovo E16 Gen1 with Intel Iris adjust brightness, get Fn-Keys working
On Tue, 2023-10-24 at 09:32 +0200, basti wrote:
>
> OK, I can write the values to
> /sys/class/backlight/intel_backlight/brightness
>
> The default is 15040, which seems to be the maximum.
> Nothing visible changes between 15040 and 13000.
> 60 is very dark.
> It therefore looks like an exponential function.
>
> I have to see how I can represent this in a function to use it with the
> fn-keys.
>
You can edit ~/.config/openbox/lxde-rc.xml
Here's my full notes from when I did what your trying to do on a laptop
many years ago. This obviously needs modifying for your machine...
0. Edit /etc/rc.local to add
# make brightness writeable
chmod a+w /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness
# set brightness to a nice default
echo 1200 >/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness
The make file executable
chmod a+x /etc/rc.local
UPDATE: rc.local now needs a shebang at the top, i.e. #!/bin/sh
1. Create /home/tixy/bin/bl- to reduce brightness in steps
#!/bin/bash
device="/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight"
step=200
curval=`cat $device/brightness`
newval=`echo $(expr $curval - $step)`
if [ $newval -le $step ]; then
newval=$step
fi
echo $newval
echo $newval >$device/brightness
2. Create /home/tixy/bin/bl+ to increase brightness in steps
#!/bin/bash
device="/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight"
step=200
curval=`cat $device/brightness`
maxval=`cat $device/max_brightness`
newval=`echo $(expr $curval + $step)`
if [ $newval -ge $maxval ]; then
newval=maxval
fi
echo $newval
echo $newval >$device/brightness
3. Edit '<keyboard>' section of ~/.config/openbox/lxde-rc.xml
<keybind key="XF86MonBrightnessUp">
<action name="Execute">
<command>/home/tixy/bin/bl+</command>
</action>
</keybind>
<keybind key="XF86MonBrightnessDown">
<action name="Execute">
<command>/home/tixy/bin/bl-</command>
</action>
</keybind>
Reply to: