4

Problem

Hi, I'm struggling with key repeat setting.

It's really annoying that key repeat setting is reset when bluetooth keyboard is connected (every time).

Note that repeat key setting using gsetting or Settings - Universal Access - Repeat Keys has the same problem.

Is there any way to resolve this problem?

Configratuion

  • OS: Ubuntu 20.04
  • Keyboard: HHKB Professional Hybrid

1 Answers1

0

I use the following script for this use case. Adjust the 300/301 as you prefer. Save this script in /home/$USER/scripts and link it with

ln -s /home/$USER/scripts/toggle_keyboard_delay.sh /lib/systemd/system-sleep/toggle_keyboard_delay.sh

#!/bin/sh

PATH=/sbin:/usr/sbin:/bin:/usr/bin

this code is linked so that it runs after system wakes up from sleep:

ln -s /home/$USER/scripts/toggle_keyboard_delay.sh /lib/systemd/system-sleep/toggle_keyboard_delay.sh

chmod +x /home/$USER/scripts/toggle_keyboard_delay.sh

Get the current keyboard delay value

current_delay=$(gsettings get org.gnome.desktop.peripherals.keyboard delay)

Check if the current delay is 300

if [ "$current_delay" = "uint32 300" ]; then

Set the delay to 301

gsettings set org.gnome.desktop.peripherals.keyboard delay 301 else

Set the delay to 300

gsettings set org.gnome.desktop.peripherals.keyboard delay 300 fi

exit 0

maxbellec
  • 101