Topic: LCD brightness?

How do i adjust LCD brightness on the command-line  (or via GUI)? I've tried the following -- all fail

xbacklight -set 50 --> No outputs have backlight property
xrandr --output LVDS1 --brightness 0.5 --> no stdout, no change in brightness

Re: LCD brightness?

Take a look at the files in /sys/class/backlight/backlight. echo'ing to brightness lets you change it; max_brightness tells you the largest acceptable value (12 for me, and presumably everyone else).

the armada xserver needs to be patched to make use of that before the XRandR extension can control the backlight. the intel xserver has code for that. i started looking at lifting it and bringing it into novena's xserver. haven't had time to get anywhere.

Re: LCD brightness?

I didn't realize there was an X11 extension that allowed for backlight control.

I see the Intel implementation.  It seems that all you have to do is create an Atom with the name "Backlight" and listen for properties.  That'd be a good thing to support.  Right now brightness is controlled by shelling out to write directly into the brightness file.

4 (edited by bstafford 2015-04-08 01:15:17)

Re: LCD brightness?

One wrinkle on setting the brightness like this:

sudo echo 12 > /sys/class/backlight/backlight/brightness

If you try to do it from a non-root account using sudo, it will fail with the error "permission denied," despite the use of sudo. If I understand it correctly, this is because the sudo only applies to the echo command, not the file writing caused by the redirect operator.

Instead, execute the entire command in a privileged shell:

sudo sh -c "echo 12 > /sys/class/backlight/backlight/brightness"

This worked for me.

Edit: add missing quotation mark

Re: LCD brightness?

Correct, everything to the right of the ">" is executed as your user, and everything to the left is executed as sudo.

Another option is to run:

echo 12 | sudo tee /sys/class/backlight/backlight/brightness

...or to add support to the X server.

Re: LCD brightness?

There's a convenient GUI control for LCD brightness if you add the xfce panel item "Power Manager Plugin". It's primarily a battery status indicator, but once it's there, if you click on the item in the panel, the dropdown has a screen brightness control too.

xfce panel configuring: