Autostart of keyboard illumination

Hi, how can I auto-start the keyboard illumination? What I tried was ‘/usr/bin/xset led 3’ with ‘startup’. However, this did not show to be effective. Best regards, b

1 Like

can you check if the leds are exposed as backlight device under /sys/class/leds ?
If yes there’s service systemd-backlight responsible for restoring backlight on boot. Eg. on my laptop it is set as

# systemctl cat systemd-backlight@leds:dell::kbd_backlight.service
# /usr/lib/systemd/system/systemd-backlight@.service
#  SPDX-License-Identifier: LGPL-2.1+
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Load/Save Screen Backlight Brightness of %i
Documentation=man:systemd-backlight@.service(8)
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=sysinit.target shutdown.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/systemd/systemd-backlight load %i
ExecStop=/usr/lib/systemd/systemd-backlight save %i
TimeoutSec=90s
StateDirectory=systemd/backlight
1 Like

i dont have this, any idea how i add it?

What’s the output of systemctl | grep backlight? eg here’s mine:

# systemctl | grep backlight
  sys-devices-pci0000:00-0000:00:02.0-drm-card0-card0\x2deDP\x2d1-intel_backlight.device   loaded active plugged   /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight   
  sys-devices-platform-dell\x2dlaptop-leds-dell::kbd_backlight.device                      loaded active plugged   /sys/devices/platform/dell-laptop/leds/dell::kbd_backlight                   
  systemd-backlight@backlight:intel_backlight.service                                      loaded active exited    Load/Save Screen Backlight Brightness of backlight:intel_backlight           
  systemd-backlight@leds:dell::kbd_backlight.service                                       loaded active exited    Load/Save Screen Backlight Brightness of leds:dell::kbd_backlight            
  system-systemd\x2dbacklight.slice                                                        loaded active active    system-systemd\x2dbacklight.slice

sys-devices-pci0000:00-0000:00:02.0-drm-card0-card0\x2deDP\x2d1-intel_backlight.device loaded active plugged /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight
systemd-backlight@backlight:intel_backlight.service loaded active exited Load/Save Screen Backlight Brightness of backlight:intel_backlight
system-systemd\x2dbacklight.slice loaded active active system-systemd\x2dbacklight.slice

sorry for the format dont know how to cut and paste like you did.
thanks for any help on this

I have the following outputs with (Librem 15v4) :

$ sudo nano /usr/lib/systemd/system/systemd-backlight@.service

SPDX-License-Identifier: LGPL-2.1+

This file is part of systemd.

systemd is free software; you can redistribute it and/or modify it

under the terms of the GNU Lesser General Public License as published by

the Free Software Foundation; either version 2.1 of the License, or

(at your option) any later version.

[Unit]
Description=Load/Save Screen Backlight Brightness of %i
Documentation=man:systemd-backlight@.service(8)
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=sysinit.target shutdown.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/lib/systemd/systemd-backlight load %i
ExecStop=/lib/systemd/systemd-backlight save %i
TimeoutSec=90s
StateDirectory=systemd/backlight

I have the following outputs with:

$ systemctl | grep backlight

sys-devices-pci0000:00-0000:00:02.0-drm-card0-card0\x2deDP\x2d1-intel_backlight.device loaded active plugged /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight
systemd-backlight@backlight:intel_backlight.service loaded active exited Load/Save Screen Backlight Brightness of backlight:intel_backlight
system-systemd\x2dbacklight.slice loaded active active system-systemd\x2dbacklight.slice

But which setting to change that backlight is still on after a reboot?

best regards

1 Like

same out put here.
i have a librem 13v2

Right so it’s not in any way exposed as backlight subsys. Which is probably because it doesn’t support brightness adjustment, only on/off. Can you check other led classes with ls -la /sys/class/leds/

total 0
drwxr-xr-x 2 root root 0 Apr 9 19:41 .
drwxr-xr-x 52 root root 0 Apr 9 17:06 …
lrwxrwxrwx 1 root root 0 Apr 9 17:07 ath9k-phy0 -> …/…/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/leds/ath9k-phy0
lrwxrwxrwx 1 root root 0 Apr 9 17:06 input0::capslock -> …/…/devices/platform/i8042/serio0/input/input0/input0::capslock
lrwxrwxrwx 1 root root 0 Apr 9 17:06 input0::numlock -> …/…/devices/platform/i8042/serio0/input/input0/input0::numlock
lrwxrwxrwx 1 root root 0 Apr 9 17:06 input0::scrolllock -> …/…/devices/platform/i8042/serio0/input/input0/input0::scrolllock

ok that covers standard methods how leds are managed in linux :slight_smile: there’re also non-trivial methods like raw pwm/acpi/wmi/i2c/smb/gpio bus but without librem at hand I can hardly guide you through this remotely. Will leave that to owners or support to comment.

1 Like

thank your for your help and wise words