Re: XFCE4 Screen Brightness
Reply #8 –
My understanding from looking at the script was it stores the value in /var/cache, but sets it by copying the saved file to /sys/class/backlight/*/brightness (which you can manually echo values to as root, although there is a max_brightness file in the dir you should probably look at first) whereas XFCE saves the value in xfce4-power-manager.xml and I'm not sure exactly how or where it sets it, so if it wasn't working on some hardware it could be an XFCE bug, or perhaps some optional dependency package was missing.
start() {
ebegin 'Restoring the screen brightness'
for card in `find /sys/class/backlight/ -type l`; do
if [[ -r "/var/cache/backlight/`basename $card`-brightness-old" ]]; then
cp "/var/cache/backlight/`basename $card`-brightness-old" "/sys/class/backlight/`basename $card`/brightness"
fi
done
eend $?
}
stop() {
ebegin 'Saving the screen brightness'
if ! [[ -d '/var/cache/backlight/' ]]; then
mkdir '/var/cache/backlight'
fi
if ! [[ -w '/var/cache/backlight/' ]]; then
chmod 755 '/var/cache/backlight/'
fi
for card in `find /sys/class/backlight/ -type l`; do
cp "/sys/class/backlight/`basename $card`/brightness" "/var/cache/backlight/`basename $card`-brightness-old"
done
eend $?
}