Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To work around bug #1005495 (changing LCD brightness via hotkeys impossible), I'd like to have one command line query for increasing and one for reducing the brightness of my LCD. I could then map a hotkey to each one of this queries.

The problem is: I don't know how to increase and reduce the LCD brightness on the command line. Do you?

share|improve this question
possible duplicate of Unable to change brightness in a Lenovo laptop – Lekensteyn Jun 10 '12 at 17:30
Thanks, Lekensteyn, but it's not a duplicate since lsmod | grep ^i915 gives me no output (see accepted solution). Still looking for a solution. – user69748 Dec 14 '12 at 11:56

one more way we have to do this is with another new program named as xbacklight , open your terminal and type this

sudo apt-get install xbacklight

then type this xbacklight -set 50

there 50 stands for brightness range we can get it upto 100 from 0 .

you can also increase and decrease the brightness from present value to specified you mentioned if you want to increase to 10% from current value of brightness then you can give this

xbacklight -inc 10

and to decrease 10% you can give this

xbacklight -dec 10 
share|improve this answer
+1 for simplicity. – zpletan Jun 11 '12 at 5:31
Looks like a really simple command but what I'd need is something like xbacklight -increase 10 to increase the brightness by 10 percent. Is that possible, too? – user69748 Aug 24 '12 at 9:31
Yes you can. I've already mention that . so you can get that by xbacklight -inc 10 – Raja Aug 24 '12 at 16:53
Ok, now it's in your answer. Thanks a lot, I'll try that out. – user69748 Aug 27 '12 at 7:28
That really looks simple, but unfortunatelly it doesn't work for me. Brightness simply doesn't change, not with -dec and not with -set. I guess I'll have to hope the bug gets fixed any time soon. Thanks nevertheless. – user69748 Sep 4 '12 at 14:38

Open your terminal and type this

xrandr -q | grep " connected"

it will gives you the output as LVDS1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 331mm x 207mm

There LVDS1 Stands for your display .

so now you have to do as

xrandr --output LVDS1 --brightness 0.5

there 0.5 stands for brightness and it ranges from 0.0 to 1.0 . 0.0 -> Full black .so you have to choose the required value of brightness .

share|improve this answer
Thanks for you answer but what I'd need is something like xrandr --increase 10 to increase the brightness by 10 percent. Is that possible, too? – user69748 Dec 14 '12 at 11:50
@user69748 well, you could use my first answer for that purpose . – Raja Dec 14 '12 at 17:21
this doesn't seem to change the brightness at a hardware level – user84207 Oct 18 '13 at 6:29
Too bad this answer got so many votes. My laptop screen "emulates" darkness so to say by making things appear darker (just as when you play a video with a night scene, that has nothing to do with the screen lightness but rather with pixels masking the background light). The lightness is exactly the same, wasting even more battery than before because of the pixels than now are darker. – Mephisto Nov 16 '14 at 15:47
It fakes the brightness. The brightness does not change, it is rendered by software. – user1970939 Apr 1 at 20:58

The following works for me:

echo 400 > /sys/class/backlight/intel_backlight/brightness

I guess the maximum possible value is in the /sys/class/backlight/intel_backlight/max_brightness file.

share|improve this answer
This is useful information but it doesn't work for me. Permission denied, even if I sudo. I also tried to vim the file and edit it, but it won't let me, saying something like "Fsync failed". – Ray Nov 27 '15 at 9:25
@Ray Try this: echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness. – Mygod Nov 28 '15 at 17:39
Oh wow it works! I'm not really Linux-savvy so as far as I'm concerned right now this is magic. – Ray Nov 30 '15 at 9:45
@Ray when you do sudo echo 400 > /sys/class . .. ./brightness redirection is done by shell , not by echo. And shell still runs as your regular user, not as sudo. That's why it gives permission denied. You need to have a utility that will write to file with root permissions, which is why tee works. – Serg Mar 9 at 19:37
This is ridiculously low-level, but in fact seems to be the only thing that reliably works. It gets a bit less ugly if you sudo chmod 0646 the brightness file, so sudo isn't needed for setting brightness anymore. – leftaroundabout May 24 at 21:00

for Laptops
sudo setpci -s 00:02.0 F4.B=80
change 80 by [0-FF] to get lowest-highest brightness The value specified is in hex, so 80 will give you a 50% brightness

for Desktop [not tested by ME]
xgamma -gamma .75

share|improve this answer
Thanks for you answer but what I'd need is something like setpci --increase 10 to increase the brightness by 10 percent. Is that possible, too? – user69748 Dec 14 '12 at 11:50
thank you for this answer, it's good to know how things are done at the lower levels – user84207 Oct 18 '13 at 6:30
This was the only answer that worked for me on a Samsung NB30 Plus. – OSE Oct 21 '13 at 18:33
I can't seem to get this to work.. Should I change some parameters, perhaps, and if so, how do I find the appropriate values? – Rasmus Oct 2 '14 at 8:27

Try this in terminal:

xrandr --output LVDS1 --brightness 0.9

You can change the last value as you like, eg. 0.2

share|improve this answer
1) Output is not always LVDS1, but user can find out with xrandr --verbose 2) Doesn't change backlight intensity – user84207 Oct 18 '13 at 6:31

Here's a short line that can help you relax your eyes. Just create a crontaab with the line or make a script

xrandr --output VGA1 --brightness 0.5; sleep 20; xrandr --output VGA1 --brightness 1
share|improve this answer

KDE 4.12:

qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl setBrightness 55
share|improve this answer
can you explain what It will do ? – Raja Apr 8 '14 at 18:27

As @palacsint said, echo 244 > /sys/class/backlight/intel_backlight/brightness path works for me.

But max and min values are resent in /sys/class/backlight/intel_backlight/max_brightness and /sys/class/backlight/intel_backlight/bl_power files respectively.

Also, the actual brightness that your computer is running now is present in /sys/class/backlight/intel_backlight/actual_brightness

share|improve this answer

Make this script:

cd /sys/class/backlight
MAX="$(cat "${TARGET}/max_brightness")"
# The `/1` at the end forced bc to cast the result 
# to an integer, even if $1 is a float (which it 
# should be)
LOGIC="$(echo "($1 * ${MAX})/1" | bc)"
for i in */; do
    if [[ "${TARGET}/" != "$i" && -e "${i}brightness" ]]; then
        cat "${i}max_brightness" > "${i}brightness"
echo "$LOGIC" > "${TARGET}/brightness"

Run it as root, with any value between 0 and 1.

sudo ./ 0.5
  • If your system doesn't have an /sys/class/backlight/acpi_video0, there should be at least one directory in there, which may be device-specific (I also have a radeon_bl0, for example).
  • If you have others, keep in mind their values stack (hence the loop; pushing all the other values to 1.0, then setting the target one to the desired amount).
  • While acpi_video0 should always work, it doesn't always have the full range of physical brightnesses available. Try each one, and use the one with the largest gamut as your "TARGET"
share|improve this answer
Consider using /sys/class/backlight/*/brightness instead of trying to hard-code acpi_video0 into the script. It will allow for generalizing the path to file, which can be different - i for example have intel_backlight, not acpi_video0. That's what I've used in my script here – Serg Mar 9 at 19:41

protected by Raja Apr 23 '14 at 13:28

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.