12-02-2018, 05:37 AM
Thank you for the great advice @MarkHaysHarris777!
To get this work on my Pinebook (1080p - Arch image with i3) I had to change the file from /sys/class/backlight/lcd0/brightness to /sys/class/backlight/backlight/brightness, the top value from 100 to 10 and the stepping to single digits. I'm not sure if this is due to the hardware or the os or both.
To get the max possible value: `cat /sys/class/backlight/backlight/max_brightness`
The script to raise the brightness then looks like this:
and the one to decrease it (careful - this can completely dim the screen when the value gets to 0):
More info: https://wiki.archlinux.org/index.php/backlight
To get this work on my Pinebook (1080p - Arch image with i3) I had to change the file from /sys/class/backlight/lcd0/brightness to /sys/class/backlight/backlight/brightness, the top value from 100 to 10 and the stepping to single digits. I'm not sure if this is due to the hardware or the os or both.
To get the max possible value: `cat /sys/class/backlight/backlight/max_brightness`
The script to raise the brightness then looks like this:
Code:
#!/bin/bash
LCDVALUE=`cat /sys/class/backlight/backlight/brightness`
NEWVALUE=$(( $LCDVALUE + 1 ))
if [ $NEWVALUE -le 10 ]
then
echo $NEWVALUE > /sys/class/backlight/backlight/brightness
echo $NEWVALUE
else
echo $LCDVALUE
fi
and the one to decrease it (careful - this can completely dim the screen when the value gets to 0):
Code:
#!/bin/bash
LCDVALUE=`cat /sys/class/backlight/backlight/brightness`
NEWVALUE=$(( $LCDVALUE - 1 ))
if [ $NEWVALUE -ge 0 ]
then
echo $NEWVALUE > /sys/class/backlight/backlight/brightness
echo $NEWVALUE
else
echo $LCDVALUE
fi
More info: https://wiki.archlinux.org/index.php/backlight