Search code examples
bashxserver

Execution of some command every time a xerser starts: Turn on keyboard leds on startup by `xset led led on`


My keyboard has background-leds, which can be turned on by pressing the Scroll-Lock-Key. The command I found to do so automatically in a shell is

xset led led on

Where can I execute this command on startup, BEFORE login? Is there any script that gets executed every time the xserver is started? Currently, I wrote the command in the .profile-file in my home directory, but this is not the best solution, as the entry is needed for all users, and during login the keyboard is not illuminated (so that the key labels can't be read).

My OS is Ubuntu Mate 14.10.


Solution

  • You could edit the /etc/rc.local file which will be executed after boot and run level changes. You can just throw the command right in there. You may also be able to use ~/.xinitrc or ~/.xsession depending on your specific setup (I'm not familiar with Ubuntu Mate).