My laptop has a light under the keyboard. I doubt the keyboard light consumes a lot of power, but when it comes to laptops and batteries, every little bit helps. So I prefer it to default to being off.
I found this command that I can run at the command line which switches off the keyboard light:
echo 0 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
Which is nice, but I'd like to have it in my list of startup programs so that I don't have to remember to turn off the keyboard light, which I often forget to do.
However, it doesn't seem to work if I put it in the startup applications, and I suspect that it could be because part of it requires sudo
, so it probably doesn't have the right persmissions at startup time. Or maybe it's another issue. In any case, it doesn't run at startup.
Is there a way I can get this command to run at startup?
Best Answer
Yes,
you can add this command in rc.local file in order to be executed in ever system boot/or reboot.
Edit the file, you will need root privileges for that.
and add the command line before
exit 0
The file should read
save the file and reboot to check the results. No
sudo
is needed here, because the file is executed by theroot
user.I don't remember what the execution bits are by default (in Ubuntu) at this file, but you can add the execution bit with the following command