Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
120
rated 0 times [  120] [ 0]  / answers: 1 / hits: 151106  / 3 Years ago, sun, october 10, 2021, 2:27:05

The brightness of my laptop is reset to max on every restart. I tried the solution provided at this website but had no luck.



This command



cat /sys/class/backlight/acpi_video0/max_brightness


Returns



cat: /sys/class/backlight/acpi_video0/max_brightness: No such file or directory


Then I found that I don't have a folder named acpi_video0, but a folder called intel_backlight:



screenshot of /sys/class/backlight/intel_backlight in Nautilus



Every time I increase or decrease the brightness using the brightness control keys, the values in brightness and actual_brightness get updated.



Is there any method I could follow to set the brightness to a fixed value on every boot and vary it as and when I need it using the brightness control keys?


More From » brightness

 Answers
7

You could try adding a line to /etc/rc.local that will set the desired brightness level. To edit the file, run



sudo -H gedit /etc/rc.local


and add the following



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


so that the end result looks like this



#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

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

exit 0


Substitute X by the desired brightness level.



In case /etc/rc.local doesn't exist, as is the case with new Ubuntu releases, you'll need to create it, and make eecutable with the following commands:



printf '%s
' '#!/bin/bash' 'exit 0' | sudo tee -a /etc/rc.local
sudo chmod +x /etc/rc.local


PS: Alternatively, there may be /sys/class/backlight/acpi_video0/brightness instead of the above. Brightness levels vary wildly, and may range from 0 to 10 or to 1000. To find the maximum value, try



cat /sys/class/backlight/acpi_video0/max_brightness
or
cat /sys/class/backlight/intel_backlight/max_brightness

[#37548] Tuesday, October 12, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
puccop

Total Points: 66
Total Questions: 99
Total Answers: 93

Location: Aruba
Member since Sun, Nov 27, 2022
1 Year ago
;