# DEST='/etc/X11/xinit/xserverrc'
DEST=${HOME}/.xserverrc

# xset
xset q | grep repeat
xset r rate 500 30
xset q | grep repeat

# kbrate
sudo kbdrate -d 500 -r 30

# make permanent
REPEAT_RATE=500
DELAY_RATE=30
CONF_LINE="exec /usr/bin/X -ardelay ${REPEAT_RATE} -arinterval ${DELAY_RATE} -nolisten tcp \"$@\""

grep -qxF "${CONF_LINE}" "${DEST}" || \
  echo "${CONF_LINE}" | sudo tee -a "${DEST}" >/dev/null


# gnome
gsettings set org.gnome.desktop.peripherals.keyboard repeat-interval 30
gsettings set org.gnome.desktop.peripherals.keyboard delay 500

# hyprland
# ~/.config/hypr/hyprland.conf:
#
#input {
#    repeat_rate = 30
#    repeat_delay = 500
#}

