I would like to run a script to turn the keyboard backlight off on my Asus at login (this answer did not work). Before the introduction of
systemd in Ubuntu 15.04, I did this through
/etc/rc.local using the command
(sleep 10 && echo 0 > /sys/class/leds/asus::kbd_backlight/brightness). However, under
systemd, this no longer works.
I tried to follow the instructions here to create a
systemd service. But that didn't work. This is the text I used:
[Unit] Description=MBWD Keyboard Backlight OFF script
[Service] Type=oneshot ExecStart=/usr/lib/systemd/scripts/keyboard_backlight.sh #RemainAfterExit=yes [Install] WantedBy=multi-user.target
To call this script:
#!/bin/bash echo 0 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
I then enabled the service, started the service, and used the
systemctl preset command to enable the service at startup (I think that's what it does).
After all this, the
systemctl status command indicates that the service is enabled, and when I
systemctl start the service it does dim the keyboard. And, on reboot, that is at startup, it may work, because the keyboard does turn off when Ubuntu starts up.
HOWEVER, once I get to my login screen and login, the keyboard light comes back on. I've tried to finesse this issue by using both
sleep 20 in the script and by creating a
systemd.timer unit. Neither worked.
Can anyone help???