Wireless keyboard locks computer by waking up

With this information I can think of several ways that you might be able to workaround this issue. There have been numerous issues with keyboards and mice reported recently. This is not just occurring on Garuda, there has been reports on the Arch forum as well. The causes of this seems varied from the numerous reports. In some cases downgrading or switching kernels has helped. Bios updates have also solved these issues in some cases. In your case switching to a different power manager could help.

In the past changing the USB power scheme for the device in question can help. This workaround would increase your power consuption as your keyboard would not be put to sleep during suspend.

I have also worked around these types of issues with keyboards and mice with a systemd service.

I posted a service a few days back that might help you.

The script in that service restarts all devices on the USB bus. You can easily alter the script to only affect your keyboard (not every device on the USB bus) with a minor alteration to one section of the script:

#!/bin/bash
#the keyboard section below is commented until the correct driver is confimed
#modprobe -r atkbd
#modprobe atkbd reset=1

#Disable all USB devices
#/usr/local/bin/restart_usb.sh
set -euo pipefail
IFS=$'\n\t'

VENDOR="****"
PRODUCT="****"

for DIR in $(find /sys/bus/usb/devices/ -maxdepth 1 -type l); do
  if [[ -f $DIR/idVendor && -f $DIR/idProduct &&
        $(cat $DIR/idVendor) == $VENDOR && $(cat $DIR/idProduct) == $PRODUCT ]]; then
    echo 0 > $DIR/authorized
    sleep 1
    echo 1 > $DIR/authorized
  fi
done

The section of the above script highlighted below controls which devices are reinitiated on the USB bus:

VENDOR="****"
PRODUCT="****"

If you replace the asterisks in this section with your keyboards actual hardware device ID, then the script will only reinitiate your keybord, (not all devices connected to the USB bus). Reinitiating all devices on the USB bus should be perfectly safe either at startup or suspend. Manually running the script should only be done if you are not accessing or transferring data to USB storage devices at that time. I have run this script many many times in the past to correct issues with USB devices.

YMMV

1 Like