SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
But I have to do this everytime I boot my laptop, which is several times per day. This is annoying. The default screenbrightness is 100%. And that is very bright, blindingly.
So, I created a script in rc.d, for automatically set the screen brightness...
You need something to actually call your script. Either you can put an explicit call directly in the rc.local cript - or better yet, just add the above logic directly into rc.local.
From my side:
1. it is overridden by some other command(s) later.
2. it is executed too early.
As far as I know the laptop (hardware) used to remember the brightness and restores it automatically.
My advice would be to use a custom udev rule to set it, which is what I do. Here's mine, as example...
/etc/udev/rules.d/81-backlight.rules:
Code:
# Set the initial backlight level.
SUBSYSTEM!="backlight", GOTO="backlight_end"
ACTION!="add", GOTO="backlight_end"
# Don't use the intel_backlight if the acpi backlight control is present:
TEST=="/sys/class/backlight/acpi_video0/brightness", GOTO="backlight_acpi"
KERNEL=="intel_backlight", ATTR{brightness}="364"
LABEL="backlight_acpi"
SUBSYSTEM=="backlight", KERNEL=="acpi_video0", ATTR{brightness}="39"
LABEL="backlight_end"
It may be worth looking through your bios settings first, before you go scripting a solution for init. My Dell laptop was always booting at 100% screen brightness by default until I found that menu in the bios and set it to 50% at startup. I believe it also had a setting for the keyboard back-lighting level too.
My advice would be to use a custom udev rule to set it, which is what I do. Here's mine, as example...
/etc/udev/rules.d/81-backlight.rules:
Code:
# Set the initial backlight level.
SUBSYSTEM!="backlight", GOTO="backlight_end"
ACTION!="add", GOTO="backlight_end"
# Don't use the intel_backlight if the acpi backlight control is present:
TEST=="/sys/class/backlight/acpi_video0/brightness", GOTO="backlight_acpi"
KERNEL=="intel_backlight", ATTR{brightness}="364"
LABEL="backlight_acpi"
SUBSYSTEM=="backlight", KERNEL=="acpi_video0", ATTR{brightness}="39"
LABEL="backlight_end"
That is great. It works! 364 is too dim on my Thinkpad. I changed it to 1500.
Last edited by Alfred-Augustus; 05-16-2022 at 11:21 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.