1

If I set keyboard repeat rate with say xset r rate 250 100, disconnect my usb keyboard and then run xset -q, I can see that after disconnecting the keyboard repeat rate is automatically set to the following default values:

$ xset -q | grep delay
  auto repeat delay:  660    repeat rate:  25

Can I change the default values? Where are they stored? I'm running Debian Sid.

1

You can change the so-called seat-defaults in /etc/X11/xinit/xserverrc by adding the relevant parameters (cf. XSERVER(1)).

-ardelay milliseconds
   sets the autorepeat delay (length of time in milliseconds that a key must be depressed before autorepeat starts).

-arinterval milliseconds
   sets the autorepeat interval (length of time in milliseconds that should elapse between autorepeat-generated keystrokes).

(!) For figuring out the arinterval in ms from xset repeat frequency, compute 1000/freq.

Mine now says exec /usr/bin/X -nolisten tcp -ardelay 200 -arinterval 20 "$@"

[found on https://superuser.com/questions/935801/whenever-i-plug-in-another-keyboard-key-repeating-rate-is-reset-to-some-value]

(I used to try to make the repeat rate permanent by setting Option "AutoRepeat" "190 70" /etc/X11/xorg.conf.d/keyboard.conf, but that wouldn't stick, so I (helplessly) resorted to running a per-minute xset cron job XD)

0

When we change the settings at a bash prompt, the new settings seem to be stored only in the memory of the running X Server.

To make the changes persistent, you may have luck uncommenting the "KEYBOARD_RATE" and "KEYBOARD_DELAY" lines in /etc/kbd/config if your system has that file.

Otherwise (for Ubuntu, anyway), there tend to be various distro-specific approaches, see: https://askubuntu.com/q/140255/231504

Here's why I'm guessing the values set via xset only live in-memory in the X Server:

When I run the command under strace, like so:

strace xset r rate 175 37

It seems (based on my limited experience with strace) that the settings are written to a socket, and on my machine the socket is:

/tmp/.X11-unix/X0

To see what's on the other end of that socket:

sudo lsof +d /tmp/.X11-unix

... which outputs:

COMMAND  PID USER   FD   TYPE             DEVICE SIZE/OFF   NODE NAME
Xorg    1635 root    3u  unix 0xffff88046ae4bc00      0t0  24945 /tmp/.X11-unix/X0 type=STREAM

...which shows that the process listening to the socket is Xorg (aka The X Server). Of course, the X Server could then hypothetically persist the values to non-volatile memory somewhere, but based on multiple anecdotes from users, it would seem that's not the case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.