3

Right now I am running a cooler Master keyboard on Kubuntu 16.04. At present I have to run

xset led 3 

in Konsole in order to turn the keyboard on, which is a PITA.

How can I instruct the system to light the keyboard at boot, particularly before and after the login screen?

  • I would put the command in /etc/rc.local but you can also use a cron job with @reboot. See: https://askubuntu.com/questions/228304/how-do-i-run-a-script-at-start-up – WinEunuuchs2Unix Jan 07 '18 at 19:31
  • Can I enter the command as is, or should I enter a pathway for an *.sh file? – Timbot2000 Jan 07 '18 at 20:12
  • You can enter the command as is. A *.sh (script) file is typically only used for multi-line commands. When using cron you must find out the directory name to prefix the command. ie use which xset returns: /usr/bin/xset which is the exact command format you need to use. The simpler method is just to put the command in /etc/rc.local rather than using cron. – WinEunuuchs2Unix Jan 07 '18 at 20:23
  • Sorry WinEunuuchs2Unix, entering it in the rc.local file failed to enact the command at startup. What do we try next? – Timbot2000 Jan 08 '18 at 02:49
  • Sorry the rc.local didn't work out. I've posted an answer which I hope does work. – WinEunuuchs2Unix Jan 08 '18 at 03:42
  • This is a more generic approach that lets you either set keyboard backlight to be continuously on since boot time or to be on since boot time only during an specific time interval (e.g. 6 PM till 8 AM). – Yuri Sucupira Jun 24 '22 at 05:38

1 Answers1

3

Using "Startup Applications" instead of /etc/rc.local

  • Select the first option on your Launcher called Dash. Then type "startup" and a screen similar to this will appear: Dash Startup applications.png

  • Select the option "Startup Applications" and a screen similar to this will appear: Startup Applications 2.png

  • Select Add and this screen will appear: Startup Applications 3.png

  • Make sure you enter the command as: /usr/bin/xset led 3

  • I entered the comment as: Ubuntu 16.04 regular crash, Compiz segfault, error 4 in i965_dri.so, Fresh install but you don't need to.

Notes

I can't test this on my system because the Laptop's built-in keyboard and wireless keyboard both light up automatically.

You can't put xrandr commands in /etc/rc.local because it runs before a user logs in. xrandr commands can only be used after the user logs on.