2

I want to turn off all key repeats when X starts up. I tried adding

xset r off

to /etc/X11/xinit/xinitrc, and to other files in the same area, but this doesn't seem to work. Executing the same command in a terminal once I've booted works as expected.

This is on centOS 6.5.

SixDegrees
  • 163
  • 1
  • 6

1 Answers1

1

To customize this, create your own in your home directory. Name it .xinitrc, make sure it is an executable script, and chmod +x.

TLDP - The X Window User HOWTO - Running X

Customization is done by a .xinitrc file in ~; if present, /etc/X11/xinit/xinitrc doesn't load.

The above TLDP HOWTO suggests that there is .xclients for situations without .xinitrc.

The order of loading the files works like this:

Startx typically runs without command line arguments, but command line arguments will override its normal behavior described below. It gets client arguments from one of:

  • .xinitrc in the user's home directory, if the file exists.
  • /etc/X11/xinit/xinitrc if the above file doesn't exist.
  • /usr/X11R6/lib/X11/xinit/xinitrc by default if the above two files don't exist.

How Linux X works

As the quote reveals; startx decides this, which is a shell script that can be customized.

Tamara Wijsman
  • 57,083
  • 27
  • 185
  • 256
  • I don't have any .xinitrc or .xsession files in my home directory. When I add the command to /etc/X11/xinit/xinitrc, it has no effect; keys continue to repeat. – SixDegrees Jan 13 '15 at 13:13
  • @SixDegrees: What happens if you create those files in your home directory? If nothing; check the TLDP link above, there's a section about `.xclients` for certain situations like perhaps the one you experience. – Tamara Wijsman Jan 13 '15 at 14:08
  • Works from my home directory. Note that the project, though, pretty much requires a global setting. – SixDegrees Jan 13 '15 at 14:27
  • @SixDegrees: Do `which startx`; open that startx file in an editor, it is a shell script that passes these file locations to xinit (among other parameters) so you can make it do what you want to. If you happen to use something else than startx for starting X, there should be a similar script for that desktop environment or window manager (which may even be the rc script/systemd service file). – Tamara Wijsman Jan 13 '15 at 14:57
  • Still no joy. startx indicates that it is reading the files I had previously modified, and adding 'xset r off' in startx immediately following the xinit call likewise has no effect. So I'm thinking there's some other set of init scripts being executed, but I don't know where they might be. And since I'm trying to turn off a low-level feature, it seems like I should be able to do this at the lever of X itself. Oddly, I can put the same command in /etc/profile.d, and it works, but tying it to the shell seems odd. – SixDegrees Jan 14 '15 at 10:15
  • @SixDegrees: Please read my previous comment again about what that shell script does. It calls xinit with paths and other parameters. Also note that the xinit call is blocking and thus adding commands after it won't work. Just change any `$HOME/.xinitrc` reference into `/etc/X11/xinit/xinitrc` in the `startx` file and you should be set; for me, that can be changed in a single variable somewhere near the top of that file. It is possible that `startx` isn't used, in which case you need to consult the scripts of the DE/WM. – Tamara Wijsman Jan 14 '15 at 12:31