I have a problem with my brightness setting. When I decrease brightness to 1 and I reboot the computer, it reset to maximum brightness value. I tired to adjust it and decrease it again to 1. Why the setting doesn't save the last brightness setting for me? How can I save the current value and restore it after reboot via programming?
I also tried to add echo 0 > /sys/class/backlight/intel_backlight/brightness
in /etc/rc.local
file, but after rebooting, it reset to the maximum again.
My laptop model is Vaio SVF1521DCXW
.
Best Answer
I had another folder named
acpi_video0
in this location /sys/class/backlight/I added following command at the end but before
exit 0
ingksu gedit /etc/rc.local
file:It worked for me. And now I want to get current brightness and save it into a file to restore it at next restart.
How to functionality last adjusted brightness load after next reboot?
Step 1: Check brightness levels
Set your brightness to maximum and check current level by below command:
(my laptop max brightness is 100 :)
Now set your brightness to minimum and check current level by evoking next command:
(my laptop min brightness level is 0 :)
Step 2: Create a file to store your current brightness:
Step 3: Create a script that stores your current brightness(the
save_screen_brightness
file) when shutting down into the fileprev_brightness
that you created in the previous step:Open the
save_screen_brightness
file with your favorite editor app:And put this script into it:
Save it and go to next step ;)
Step 4: Make the script run every time we shutdown or reboot the computer:
Step 5: Load the value we stored when starting the computer:
Add the following line at the end and before
exit 0
into your/etc/rc.local
file:That's it ;)
Thanks to @Hevilath's answer and @user207402's answer and also @AiPdimi's answer