Score:0

Brightness changing even when auto brightness is disabled

ng flag

I have a new (July 2021) Dell XPS Laptop running Ubuntu 20.04.3 LTS I have turned OFF Automatic Brightness and manually set the brightness that I want. But after rebooting often the brightness resets to near maximum brightness, and I have to manually change it back to the lower setting that I prefer. How do I get it to stop doing this?

in flag
[This answer here](https://askubuntu.com/a/1391204/1222991) may help you with the brightness issue (See the first update)
MattB avatar
ng flag
Won't the change In Update #1 hard-code the brightness to 80%? I just want it to quit overriding the brightness that is manually set via the slider bars.
Score:1
in flag

One solution may be to set up a quick little script that will save the brightness value when the system shuts down, then configure the system to reload the value after booting. It's not perfect, but will do the job in a pinch.

Here's how you can set it up:

  1. Open Terminal (if it's not already open)
  2. Create a file in /etc/rc6.d, which contains actions to be performed when shutting down. For the sake of this example, the file will be called K99-save-brightness:
    sudo {editor of choice} /etc/rc6.d/K99-save-brightness 
    
    Note: Be sure to replace {editor of choice} with your editor of choice.
  3. Copy the following into the file:
    #!/bin/bash
    cat /sys/class/backlight/nvidia_0/actual_brightness > /etc/acpi/backlight-brightness
    
    Note: Be sure to replace nvidia_0 with the appropriate name that is found in /sys/class/backlight. It may be intel_backlight, nvidia_0, or something else entirely.
  4. Save the file and ensure it is set to be executable:
    sudo chmod +x /etc/rc6.d/K99-save-brightness 
    

Now every time your system shuts down, the value in actual-brightness will be written to the /etc/acpi/backlight-brightness file.

Next, you will need to run a little script after your system finishes booting. This can be accomplished via crontab like so:

  1. Open Terminal (if it's not already open)
  2. Edit crontab as the super user:
    sudo crontab -e 
    
  3. Add this one-liner:
    @reboot (sleep 10 ; cat /etc/acpi/backlight-brightness > /sys/class/backlight/nvidia_0/brightness
    
    Note: The sleep value can be anything from 2. When the value is less than 2, there is a higher probability that the backlight setting will be overridden and reset to maximum. Of course, be sure to replace nvidia_0 with the actual backlight device that you will be controlling.
  4. Save the crontab
  5. Reboot to test

This is certainly not an ideal solution, but it's one that does work on some of the notebooks that I help support at the day job. This should work on every modern version of Ubuntu from 18.04 to current.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.