How to adjust screen brightness in Ubuntu 14.04?

97,910

Solution 1

Manually changing brightness

Remember that on Linux/Unix everything is a file. Brightness value is also stored in a file. Open a command line ( aka Terminal) by pressing Ctrl+Alt+T, or by searching 'terminal' application in the dash. Then execute these commands:cd /sys/class/backlight/. cd is basically used for navigating through directories. And under backlight for me there is folder acpi_video0, but for you it may be different. Use ls command to find out what folder name it is. cd to that folder as well. So for example, I would do as show in picture

enter image description here

OK, so by now you have navigated to the folder which contains your brightness settings. Inside there is brightness file and max_brightness file.

cat max_brightness will tell you the maximum brightness that you can set on the screen. brightness is the actual file that controls brightness. You can change it from 0 to whatever number is in max_brightness.

enter image description here

See the number 7 after I did cat max_brightness ? This is my maximum brightness value, so it means i can change brightness from 0 to 7.

Now we can edit brightness file to actually change screen brightness. We will need some text editor command. I prefer using command line text editor nano. So I would do

sudo nano brightness

It will ask you for your password. Enter it, and you will see a screen something like this:

enter image description here

Do you see where is my cursor? right after the number. That's what i mean when i said, don't hit enter. This file has to have only that one line, no other. You can use left/right keys to move cursor, and backspace or del keys to delete old number, and then type new. Remember, that you can only go from whatever number was in max_brightness file to 0.

When you wrote new number, press Ctrl+X, it will ask if you want to "Save modified buffer". Press Y. Then it will asks what name of the file to write. Just press enter, we do not want to change name of this file. Done. At this point your brightness should change.

Small note on the side: The problem with graphic text editor like gedit, is that it tries to create a backup for every file, and brightness file and that folder has permissions such that only root can modify it, so it won't let gedit to change that file or create backup, even with gksudo - i tried

Script version: This script opens my brightness file with nano editor. Make necessary adjustments for your system, as some folder names may be different.

#!/bin/mksh
printf " \n Entering file to change brightness in 3 seconds\n remember - no new line after number.  ";
sleep 3;
sudo nano /sys/class/backlight/acpi_video0/brightness

Solution 2

Try the utility xbacklight.

What worked for me was:

sudo apt-get install -y xbacklight
xbacklight -set 50  # Set display backlight to 50%
xbacklight -set 100 # Set display backlight to 100%
xbacklight -inc 10  # Increase display backlight by 10%
xbacklight -dec 10  # Decrease display backlight by 10%

Confirmed to work on:

  • Ubuntu 15.10 + ASUS machine
  • Ubuntu 16.04 + MacBook Air

Solution 3

Extending @Serg's answer.

  1. Navigate to the directory containing brightness, e.g. /sys/class/backlight/intel_backlight

  2. Use sudo chmod 770 to change file permissions Note: there is some security risk associated with making this file less restricted.

  3. Use sudo chown user_name brightness where user_name is your user name. The whoami command will tell you your user name if you aren't certain. Note: there is some security risk associated with making this file less restricted.

  4. cd ~/bin. If it [1] does not exist, first mkdir ~/bin.

  5. Create a script file named "brightness" from the command line.

    $> touch brightness $> chmod 777 brightness

  6. Edit brightness with your favorite editor to:

    #!/bin/bash
    echo "$1" > /sys/class/backlight/intel_backlight/brightness
    
  7. From the command line:

    sudo ~/bin/brightness 1000

will set the brightness to 1000. Note: the appropriate settings for your machine may be different. Be sure to verify the max_brightness as mentioned above.

  1. Adding ~\bin\ to the path reduces the command to brightness <n> where n is the desired level of brightness.

[1] Or it's equivalent

Solution 4

It worked by following the article Fix Brightness Control Not Working for Ubuntu 14.04 & Linux Mint 17!

Just add the given data in the "intel file" when it's opened, copy paste, save the file, shutdown and start your system! :)

Solution 5

I am unsure about the changes that you are doing to grub and trying to install xbacklight.

But there are some good guides out there. An article from itsfoss worked for me.

Before you try out the article, open up terminal and key in acpi_listen and then press your fn+up and fn+down key combinations to check whether your brightness keys are actually getting registered by Ubuntu or not.

Share:
97,910

Related videos on Youtube

wish.naren
Author by

wish.naren

Updated on September 18, 2022

Comments

  • wish.naren
    wish.naren almost 2 years

    I am unable to alter the screen brightness in my laptop; it is always 100%.

    The laptop is Acer Aspire 5740, and graphics/chipset/VGA all are by Intel.

    The laptop has a keyboard shortcut, Fn+Right and Fn+Left which shows the brightness being increased or decreased (the brightness icon blinks on the top!), but in reality no change.

    I have other options for the same function key (Fn), like Fn+Up & Fn+Down for volume control, which are working perfectly!

    The brightness control in Ubuntu System Settings is also not responding!

    I did try a few options available here!

    (1)

    I did try to edit the "GRUB" like many have suggested. But I'm unable to locate the "LINE" to be edited, i.e. GRUB_CMDLINE_LINUX="". I get the following as the error message or so!

    (gedit:8235): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
    

    (2)

    I tried to add "xbacklight". I got the following:

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
      xbacklight
    0 upgraded, 1 newly installed, 0 to remove and 190 not upgraded.
    Need to get 8,488 B of archives.
    After this operation, 61.4 kB of additional disk space will be used.
    Get:1 ftp://ftp.iitb.ac.in/distributions/ubuntu/archives/ trusty/universe xbacklight amd64 1.1.2-1 [8,488 B]
    Fetched 8,488 B in 0s (26.5 kB/s)
    Selecting previously unselected package xbacklight.
    (Reading database ... 165039 files and directories currently installed.)
    Preparing to unpack .../xbacklight_1.1.2-1_amd64.deb ...
    Unpacking xbacklight (1.1.2-1) ...
    Processing triggers for man-db (2.6.7.1-1) ...
    Setting up xbacklight (1.1.2-1) ...
    

    The YouTube video Xbacklight - Dim Your Screen - Ubuntu 10.10 shows xbacklight as a part of keyboard shortcut, but I am unable to locate one in Ubuntu 14.04, so I tried to create a custom! With the xbacklight as the command! And Ctrl+Up & Ctrl+Down. The Ubuntu seems to recognize it, but no response!

    How can I proceed? Or I'm I making any mistake?

    At present my update/download server is the IIT-Bombay server for India. Which is the only responsive server for India.

  • wish.naren
    wish.naren over 9 years
    Thanks! I edited GRUB, but no change! and the article you shared for editing Intel Details, I get the following error message, and the screen to be edited is shown EMPTY. "(gedit:5100): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files " & how do I use "acpi_listen"
  • magnusnn
    magnusnn over 9 years
    Ah I see, can you try to edit the grub-file yet again, edit to GRUB_CMDLINE_LINUX="rootflags=sync"and add a line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor" , save the file and run sudo update-grub and reboot. let me know the result.
  • astrob0t
    astrob0t over 9 years
    Please ignore the errors that you are getting in the terminal while editing in geditor. Add those lines as suggested in the link, and save and exit geditor. Then logout and log in back
  • astrob0t
    astrob0t over 9 years
    open terminal, key in acpi_listen and hit enter. the cursor will start blinking awaiting your inputs. now press the key combinations for adjusting brightness. you would see some output in the terminal and if the keys are not working, there wount be any output visible. When done testing, simple press ctrl+c to exit.
  • wish.naren
    wish.naren over 9 years
    thanks, I did the same, and it is being described for "brightness up" and "brightness_down" same goes for "Volume Up/Down"
  • astrob0t
    astrob0t over 9 years
    ok. that's good. this means, the keys are getting registered. now can you give the output of ls /sys/class/backlight/
  • wish.naren
    wish.naren over 9 years
    thanks, but I'm totally new, and I'm unable to understand ur descriptions! sorry! I did try though!
  • wish.naren
    wish.naren over 9 years
    it says "acer-wmi intel_backlight"
  • Sergiy Kolodyazhnyy
    Sergiy Kolodyazhnyy over 9 years
    OK, I will try to edit my answer a little
  • wish.naren
    wish.naren over 9 years
    I think now my brightness is set for the lowest intensity! but no change in terms of setting the brightness to high/low!
  • astrob0t
    astrob0t over 9 years
    You do have intel drivers controlling your brightness. now open terminal and paste lspci | grep -i vga and provide the output
  • wish.naren
    wish.naren over 9 years
    okay! it says "00:02.0 VGA compatible controller:Intel Corporation Core Processor Integrated Graphics Controller (rev12)"
  • astrob0t
    astrob0t over 9 years
    now paste sudo gedit /usr/share/X11/xorg.conf.d/20-intel.conf in the terminal. this would open geditor. Copy the following to the file and save and exit, logout and log in back again. you may ignore any error messages that appears in the terminal. Section "Device" Identifier "card0" Driver "intel" Option "Backlight" "intel_backlight" BusID "PCI:0:02:0" EndSection
  • wish.naren
    wish.naren over 9 years
    thanks again, but the file being opened is totally empty! am I suppose to type the entire thing there? the msg in terminal while opening of file is "(gedit:2723): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files (gedit:2723): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files"
  • astrob0t
    astrob0t over 9 years
    Yes the file is supposed to be empty. you need to type in the entire thing.
  • wish.naren
    wish.naren over 9 years
    Thanks, I think I nearly solved the issue, by following this article, itsfoss.com/fix-brightness-ubuntu-1310 provided by "astrobot" below! now I'm able to edit the brightness like I want! :)
  • wish.naren
    wish.naren over 9 years
    It worked! thanks, and let me add it to the article!
  • user540922
    user540922 over 9 years
    Another possible argument for the GRUB_CMDLINE_LINUX_DEFAULT line, which works very well for me, is video.use_native_backlight=1.
  • Francisco Luz
    Francisco Luz about 9 years
    The solution from that link also worked for me. Thank you.
  • BHS
    BHS over 8 years
    This worked for me on Ubuntu 14.04. Looks the xserver just needs to be explicitly told which type of brightness hardware you have.
  • Alexey Shvechkov
    Alexey Shvechkov over 8 years
    this works, but command should be "xbacklight -set 50", "xbacklight -set 100", etc
  • choz
    choz about 8 years
    This works for me as xbacklight =50
  • Zanna
    Zanna almost 8 years
    that prompt means business :D
  • Sergiy Kolodyazhnyy
    Sergiy Kolodyazhnyy almost 8 years
    Oh, boy. . . .this was forever ago. . . .so much ^_^''''''
  • Jacksonkr
    Jacksonkr over 7 years
    Didn't work for me. #mbp2015 #ubuntu1404
  • Shai M.
    Shai M. over 7 years
    add to bash_profile alias brightness="sudo subl /sys/class/backlight/intel_backlight/brightness"
  • ben rudgers
    ben rudgers over 7 years
    @ShaiM. My Ubuntu installation does not have Sublime Text.
  • Shai M.
    Shai M. over 7 years
    You are right. you can use any editor you would like. :) Thanks for the answer!
  • ben rudgers
    ben rudgers over 7 years
    @ShaiM. The implementation I describe does not display an editor to the user. Instead it runs in a way a user expects the command line utility to operate. A more sophisticated implementation can do bounds checking based on the specific limits of a display. For example, my Thinkpad had a maximum brightness value around ~3000, my current laptop has a maximum brightness value of 937. The utility could abstract away such differences by accepting keywords like "maximum", "half", "dim", etc.
  • Rubanraj Ravichandran
    Rubanraj Ravichandran over 7 years
    This is worked perfectly for me in ubuntu 14.04.
  • Sterls
    Sterls almost 7 years
    Does not work for Ubuntu 16.04 on Asus ROG machine.
  • Jam
    Jam almost 7 years
    Works perfectly for me on Ubuntu 16.04 on an ASUS laptop