6

Freshly installed 14.04, CoolerMaster Storm keyboard. I'm not at all concerned with being able to toggle/turn off the LED, I simply want the LED to turn on before login, i.e. while looking at the login screen, the LED should already be on.

I've set up a keyboard shortcut to run xset led 3, but this is less than ideal, as I have to be logged in in order to use the shortcut. I'd like this to happen automatically instead.

I'm very new to both Linux and scripting, so please ELI5/walk me through it. I know that you can run scripts at startup as per this, but I don't understand how to actually write the script or how to "put it in" /etc/rc.local. Do I simply fire up gedit and type xset led 3 directly into rc.local below the #comments, but above the exit 0? Do I make another script somewhere else and link to it in rc.local? Am I overthinking it (probably)?

In short, I'd like a more detailed explanation of what Mitch was saying in the link. Thanks for your time.

Baku9
  • 146

1 Answers1

1

Open the terminal, enter sudo -s to get root-access. Now enter nano /etc/rc.local, now edit the file so it looks like this:

!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

xset led 3
exit 0

Now save with Ctrl + O, press enter and then Ctrl + X to exit.

Let's set the proper permissions using:

sudo chown root /etc/rc.local
sudo chmod 755 /etc/rc.local

Make sure everything works fine using:

sudo /etc/init.d/rc.local start

And now reboot.

CubeDev
  • 198