Ubuntu – How to change LCD brightness from command line (or via script)

backlightbrightnesscommand line

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?

Best Answer

  • 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 level and it ranges from 0.0 to 1.0 . 0.0 -> Full black .so you have to choose the required value of brightness .

    This doesn't change brightness at a hardware level. From randr manual:

    --brightness brightness Multiply the gamma values on the crtc currently attached to the output to specified floating value. Useful for overly bright or overly dim outputs. However, this is a software only modification, if your hardware has support to actually change the brightness, you will probably prefer to use xbacklight.