I cannot seem to set the keyboard repeat rate permanently no matter what. I don't like the default setting as it is way too slow. After setting the keyboard Character Repeat delay and interval via "Preferences" -> "Mouse and Keyboard Settings" for faster keyboard repeat rate, it would work ok for a little while, but it reverts back to its original setting after sleep/awake or after reboot or even randomly out of the blue. I'm on Raspbian Stretch 9.9.

In ~/.config/autostart/LXinput-setup.desktop, I also see:

[Desktop Entry]
Name=LXInput autostart
Comment=Setup keyboard and mouse using settings done in LXInput
Exec=sh -c 'xset m 20/10 10 r rate 301 10 b off; xinput --set-prop "pointer:dou DZ60" "libinput Accel Speed" 0.660000; xinput --set-prop "pointer:Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)" "libinput Accel Speed" 0.660000'

But the keyboard setting (indicated by the line Exec=sh -c 'xset...')seems to be not effective, unless I go to "Mouse and Keyboard Settings", and fiddle with the sliders few times. And just like before, the keyboard repeat returns to its original setting after awhile, even though this file didn't change at all.

I've also tried the following.

On the terminal, xset is the only thing that works, but it's only a temporary solution as it reverts back to original setting when RPi reboots, so I have to re-type this after every single reboot, which is not ideal:

$ xset r rate 300 80

I tried adding the following line in /etc/rc.local, just before exit 0, but had no effect:

#!/bin/sh -e
xset r rate 300 80
exit 0

I've added these line to ~/.config/lxsession/LXDE/desktop.conf and ~/.config/lxsession/LXDE-pi/desktop.conf, and even /etc/xdg/lxsession/LXDE-pi/desktop.conf but it didn't work:


# then Reboot or run `lxsession -r`

I've tried this (as I heard it was effective on some Ubuntu --I know I'm on Raspbian/debian but tried anyway), but no luck:

gsettings set org.gnome.desktop.peripherals.keyboard delay 150
gsettings set org.gnome.desktop.peripherals.keyboard repeat-interval 11

I also see /etc/lightdm/lightdm.conf as a possible place for keyboard setting, but I have no idea.

EDIT: I've just installed stock Raspbian Buster, and it still fails to set the keyboard repeat rate after reboot.

3 Answers 3


It's been recommended to set a related Kernel parameter to increase repeat speed and decrease repeat delay. By default, the value is 250ms.


This is controlled by the /boot/cmdline.txt file on a Raspberry Pi. It's likely better to add to the end of the line, not the beginning.

Alternatively, you can run xset r rate DELAY RATE to adjust the rate and delay settings. To do this for your user when you login, you could add your command to ~/.xinitrc:

xset r rate 100 60  
  • Unfortunately, Raspberry Pi doesn't use grub, so I don't know where to put atkbd.softrepeat=1. Also ~/.xinitrc doesn't exist. I created it and added the xset r rate 100 60 but it didn't work. I had also tried ~/.xprofile before.
    – otter.pro
    Commented Jun 27, 2019 at 1:35
  • Derp forgot about that. We'd edit /boot/cmdline.txt then, eh? You do not run atkbd, you adjust atkbd's softrepeat configuration value.
    – earthmeLon
    Commented Jun 27, 2019 at 15:23

The only solution that worked for me is this workaround, which is not ideal: launch the terminal app via autostart when the Linux desktop (LXDE) launches, which then runs xset to set the keyboard repeat rate.

First, edit the file /etc/xdg/lxsession/LXDE-pi/autostart (requires root or sudo)

And add line @lxterminal

Then, edit ~/.bashrc and add the following lines:

if [[ $DISPLAY ]]; then
    /usr/bin/xset r rate 300 80

I had the same issue, it can be easily fixed by adding some small delay in ~/.config/autostart/LXinput-setup.desktop before the xset command, for instance:

Exec=sh -c 'sleep 5; xset m 20/10 10 r rate 250 33 b on; [...]'

Note: maybe even less than 5 seconds would be enough, I did not try.

I have just opened an issue on GitHub.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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