Wireless keyboard locks computer by waking up

My ROG Strix scope tkl wireless keyboard has this thing where it will go to sleep after not being used for a while, the problem is, when I press a key on the keyboard it all of a sudden locks the session as if i’d pressed super + L.

I searched online and couldn’t find anything about this

The keycodes showkeys showed:

keycode  28 release
keycode  57 press
keycode  57 release
keycode 116 press
keycode 142 press
keycode 143 press

28 was the release of enter to start showkeys
57 was space to wake the keyboard
I don’t know what the others are

garuda-inxi:

System:
  Kernel: 6.11.5-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: hpet avail: acpi_pm
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=abc4a0db-f265-41ab-939e-e96cdcedcd18 rw rootflags=subvol=@
    quiet resume=UUID=31365f32-cf8b-46e0-a6a4-dc55dd0d02f3 loglevel=3 ibt=off
  Desktop: KDE Plasma v: 6.2.2 tk: Qt v: N/A info: frameworks v: 6.7.0
    wm: kwin_wayland vt: 1 dm: SDDM Distro: Garuda base: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: ROG Strix G513IE_G513IE v: 1.0
    serial: <superuser required>
  Mobo: ASUSTeK model: G513IE v: 1.0 serial: <superuser required>
    uuid: <superuser required> UEFI: American Megatrends LLC. v: G513IE.329
    date: 03/01/2023
Battery:
  ID-1: BAT0 charge: 43.8 Wh (100.0%) condition: 43.8/56.0 Wh (78.2%)
    volts: 16.9 min: 15.9 model: AS3GWZC3KC G513-36 type: Li-ion
    serial: <filter> status: full
CPU:
  Info: model: AMD Ryzen 7 4800H with Radeon Graphics bits: 64 type: MT MCP
    arch: Zen 2 gen: 2 level: v3 note: check built: 2020-22
    process: TSMC n7 (7nm) family: 0x17 (23) model-id: 0x60 (96) stepping: 1
    microcode: 0x8600106
  Topology: cpus: 1x dies: 1 clusters: 1 cores: 8 threads: 16 tpc: 2
    smt: enabled cache: L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB
    desc: 8x512 KiB L3: 8 MiB desc: 2x4 MiB
  Speed (MHz): avg: 2147 min/max: 400/4300 boost: enabled scaling:
    driver: amd-pstate-epp governor: powersave cores: 1: 2147 2: 2147 3: 2147
    4: 2147 5: 2147 6: 2147 7: 2147 8: 2147 9: 2147 10: 2147 11: 2147 12: 2147
    13: 2147 14: 2147 15: 2147 16: 2147 bogomips: 92629
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
Graphics:
  Device-1: NVIDIA GA107M [GeForce RTX 3050 Ti Mobile] vendor: ASUSTeK
    driver: nvidia v: 560.35.03 alternate: nouveau,nvidia_drm non-free: 550.xx+
    status: current (as of 2024-09; EOL~2026-12-xx) arch: Ampere code: GAxxx
    process: TSMC n7 (7nm) built: 2020-2023 pcie: speed: Unknown lanes: 63
    link-max: gen: 6 speed: 64 GT/s ports: active: none empty: DP-1
    bus-ID: 01:00.0 chip-ID: 10de:25a0 class-ID: 0300
  Device-2: Advanced Micro Devices [AMD/ATI] Renoir [Radeon Vega Series /
    Radeon Mobile Series] vendor: ASUSTeK driver: amdgpu v: kernel arch: GCN-5
    code: Vega process: GF 14nm built: 2017-20 pcie: gen: 3 speed: 8 GT/s
    lanes: 16 link-max: gen: 4 speed: 16 GT/s ports: active: HDMI-A-1,eDP-1
    empty: none bus-ID: 06:00.0 chip-ID: 1002:1636 class-ID: 0300 temp: 51.0 C
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.3
    compositor: kwin_wayland driver: X: loaded: nvidia gpu: nvidia,amdgpu
    d-rect: 3840x1080 display-ID: 0
  Monitor-1: HDMI-A-1 pos: right res: 1920x1080 size: N/A modes: N/A
  Monitor-2: eDP-1 pos: primary,left res: 1920x1080 size: N/A modes: N/A
  API: EGL v: 1.5 hw: drv: nvidia drv: amd radeonsi platforms: device: 0
    drv: nvidia device: 2 drv: radeonsi device: 3 drv: swrast gbm: drv: nvidia
    surfaceless: drv: nvidia wayland: drv: radeonsi x11: drv: radeonsi
    inactive: device-1
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: amd mesa v: 24.2.5-arch1.1
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon Graphics (radeonsi
    renoir LLVM 18.1.8 DRM 3.59 6.11.5-zen1-1-zen) device-ID: 1002:1636
    memory: 500 MiB unified: no display-ID: :1.0
  API: Vulkan v: 1.3.295 layers: 14 device: 0 type: integrated-gpu name: AMD
    Radeon Graphics (RADV RENOIR) driver: mesa radv v: 24.2.5-arch1.1
    device-ID: 1002:1636 surfaces: xcb,xlib,wayland device: 1
    type: discrete-gpu name: NVIDIA GeForce RTX 3050 Ti Laptop GPU
    driver: nvidia v: 560.35.03 device-ID: 10de:25a0
    surfaces: xcb,xlib,wayland device: 2 type: cpu name: llvmpipe (LLVM
    18.1.8 256 bits) driver: mesa llvmpipe v: 24.2.5-arch1.1 (LLVM 18.1.8)
    device-ID: 10005:0000 surfaces: xcb,xlib,wayland
Audio:
  Device-1: NVIDIA vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie:
    gen: 3 speed: 8 GT/s lanes: 8 link-max: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 01:00.1 chip-ID: 10de:2291 class-ID: 0403
  Device-2: Advanced Micro Devices [AMD/ATI] Renoir Radeon High Definition
    Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie: gen: 3
    speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s bus-ID: 06:00.1
    chip-ID: 1002:1637 class-ID: 0403
  Device-3: Advanced Micro Devices [AMD] ACP/ACP3X/ACP6x Audio Coprocessor
    vendor: ASUSTeK driver: N/A alternate: snd_pci_acp3x, snd_rn_pci_acp3x,
    snd_pci_acp5x, snd_pci_acp6x, snd_acp_pci, snd_rpl_pci_acp6x, snd_pci_ps,
    snd_sof_amd_renoir, snd_sof_amd_rembrandt, snd_sof_amd_vangogh,
    snd_sof_amd_acp63 pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4
    speed: 16 GT/s bus-ID: 06:00.5 chip-ID: 1022:15e2 class-ID: 0480
  Device-4: Advanced Micro Devices [AMD] Family 17h/19h HD Audio
    vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s
    lanes: 16 link-max: gen: 4 speed: 16 GT/s bus-ID: 06:00.6
    chip-ID: 1022:15e3 class-ID: 0403
  API: ALSA v: k6.11.5-zen1-1-zen status: kernel-api with: aoss
    type: oss-emulator tools: N/A
  Server-1: PipeWire v: 1.2.6 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: e000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: MEDIATEK MT7921 802.11ax PCI Express Wireless Network Adapter
    vendor: AzureWave driver: mt7921e v: kernel pcie: gen: 2 speed: 5 GT/s
    lanes: 1 bus-ID: 03:00.0 chip-ID: 14c3:7961 class-ID: 0280
  IF: wlp3s0 state: down mac: <filter>
  Device-3: ASUSTek ROG STRIX SCOPE RX TKL WIRELESS DELUXE
    driver: hid-generic,usbhid type: USB rev: 2.0 speed: 12 Mb/s lanes: 1
    mode: 1.1 bus-ID: 3-2:3 chip-ID: 0b05:1a07 class-ID: 0300
  Info: services: NetworkManager, systemd-timesyncd, wpa_supplicant
Bluetooth:
  Device-1: IMC Networks Wireless_Device driver: btusb v: 0.8 type: USB
    rev: 2.1 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-4:4 chip-ID: 13d3:3563
    class-ID: e001 serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 5.2
    lmp-v: 11 status: discoverable: no pairing: no class-ID: 6c010c
Drives:
  Local Storage: total: 1.38 TiB used: 23.4 GiB (1.7%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital
    model: WD BLACK SN770 1TB size: 931.51 GiB block-size: physical: 512 B
    logical: 512 B speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 731100WD temp: 47.9 C scheme: GPT
  ID-2: /dev/nvme1n1 maj-min: 259:7 vendor: Samsung
    model: MZVLQ512HBLU-00B00 size: 476.94 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: FXM7201Q temp: 41.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 60.06 GiB size: 60.06 GiB (100.00%)
    used: 16.47 GiB (27.4%) fs: btrfs dev: /dev/nvme0n1p5 maj-min: 259:5
  ID-2: /boot/efi raw-size: 500 MiB size: 499 MiB (99.80%)
    used: 584 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p3 maj-min: 259:3
  ID-3: /home raw-size: 322.27 GiB size: 322.27 GiB (100.00%)
    used: 6.93 GiB (2.2%) fs: btrfs dev: /dev/nvme0n1p6 maj-min: 259:6
  ID-4: /var/log raw-size: 60.06 GiB size: 60.06 GiB (100.00%)
    used: 16.47 GiB (27.4%) fs: btrfs dev: /dev/nvme0n1p5 maj-min: 259:5
  ID-5: /var/tmp raw-size: 60.06 GiB size: 60.06 GiB (100.00%)
    used: 16.47 GiB (27.4%) fs: btrfs dev: /dev/nvme0n1p5 maj-min: 259:5
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: zram size: 15.04 GiB used: 0 KiB (0.0%) priority: 100
    comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 16 dev: /dev/zram0
  ID-2: swap-2 type: partition size: 7.81 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p4 maj-min: 259:4
Sensors:
  System Temperatures: cpu: 72.8 C mobo: 46.0 C gpu: amdgpu temp: 52.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 16 GiB note: est. available: 15.04 GiB used: 2.51 GiB (16.7%)
  Processes: 404 Power: uptime: 0m states: freeze,mem,disk suspend: s2idle
    wakeups: 0 hibernate: platform avail: shutdown, reboot, suspend, test_resume
    image: 5.97 GiB services: org_kde_powerdevil, power-profiles-daemon,
    upowerd Init: systemd v: 256 default: graphical tool: systemctl
  Packages: pm: pacman pkgs: 1836 libs: 547 tools: octopi,paru Compilers:
    clang: 18.1.8 gcc: 14.2.1 Shell: garuda-inxi default: fish v: 3.7.1
    running-in: konsole inxi: 3.3.36
Garuda (2.6.26-1):
  System install date:     2024-10-25
  Last full system update: 2024-10-26
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager dracut nvidia-dkms
  Windows dual boot:       Probably (Run as root to verify)
  Failed units:            

I’m thinking those are probably power, sleep, and wakeup keycodes; as that could explain why you would be getting to a lock screen.
I have no idea why the keyboard is doing that either (was searching for a few hours myself). Might be a defect or some odd quirk :man_shrugging:

I can think of a possible workaround using logind.conf.
I would suggest making a drop-in file in the folder /etc/systemd/logind.conf.d/ so you can easily revert to defaults by removing the file later if need be.

[Login]
HandleSuspendKey=ignore
HandlePowerKey=ignore

After saving the file with that as the contents in /etc/systemd/logind.conf.d/ , restart the computer and try to see if the issue persists.

1 Like

I changed the file and restarted but nothing has changed, my power button still works and my keyboard still does the same thing

I would suggest testing out a wired keyboard just to rule out the possibility that the keyboard in use is in some way responsible.

As you only installed your system days ago, we have no idea of if a kernel change could be responsible for this strange behaviour. I would suggest testing out the linux-lts and linux-mainline kernels just to rule out a recent kernel regression as the cause.

Ok so… This is weird, I just reinstalled the OS because I was having a generous amount of trouble with sddm switching from wayland to xorg, and the problem seems to be fixed, I have no Idea what could have been causing it.

1 Like

The issue is back, I am starting to think that somehow some change I made by installing or uninstalling something leads to this problem.

These are my most recent changes from snapper. And it must have happened after installing firefox because it was in Firefox that I made my confused previous post.

#  │ Type   │ Pre # │ Date                     │ User │ Cleanup │ Description                                                              │ Userdata
───┼────────┼───────┼──────────────────────────┼──────┼─────────┼──────────────────────────────────────────────────────────────────────────┼─────────
0  │ single │       │                          │ root │         │ current                                                                  │
3  │ pre    │       │ qua 30 out 2024 17:44:02 │ root │ number  │ pacman -S --needed discord firefox garuda-wallpapers-extra               │
4  │ post   │     3 │ qua 30 out 2024 17:44:04 │ root │ number  │ firefox garuda-wallpapers-extra                                          │
5  │ pre    │       │ qua 30 out 2024 18:47:32 │ root │ number  │ pacman -R firedragon-extension-plasma-integration firedragon             │
6  │ post   │     5 │ qua 30 out 2024 18:47:34 │ root │ number  │ firedragon firedragon-extension-plasma-integration                       │
7  │ pre    │       │ qua 30 out 2024 22:22:20 │ root │ number  │ pacman -Su                                                               │
8  │ post   │     7 │ qua 30 out 2024 22:22:23 │ root │ number  │ intel-media-driver mhwd-nvidia mpg123 thunderbird webkit2gtk webkit2gtk- │
9  │ pre    │       │ qui 31 out 2024 13:42:00 │ root │ number  │ pacman -R nextcloud-client                                               │
10 │ post   │     9 │ qui 31 out 2024 13:42:03 │ root │ number  │ nextcloud-client                                                         │
11 │ pre    │       │ qui 31 out 2024 15:17:26 │ root │ number  │ pacman -S postman                                                        │
12 │ post   │    11 │ qui 31 out 2024 15:17:35 │ root │ number  │ postman-bin                                                              │

Could any of these possibly be the culprit?

Thats only parts, use

cat /var/log/pacman.log | grep -E 'installed|upgraded|removed'

or by date

cat /var/log/pacman.log | grep '2024-10-31' | grep -E 'installed|upgraded|removed'

These are the results since firefox

[2024-10-30T17:44:03+0000] [ALPM] installed firefox (132.0-1)
[2024-10-30T17:44:03+0000] [ALPM] installed garuda-wallpapers-extra (r12.eaf3832-1)
[2024-10-30T18:47:32+0000] [ALPM] removed firedragon-extension-plasma-integration (1.9-1.1)
[2024-10-30T18:47:32+0000] [ALPM] removed firedragon (1:11.19.1_2-1)
[2024-10-30T22:22:20+0000] [ALPM] upgraded intel-media-driver (24.3.3-1 -> 24.4.1-1)
[2024-10-30T22:22:20+0000] [ALPM] upgraded mhwd-nvidia (560.35.03.18-1 -> 560.35.03.19-1)
[2024-10-30T22:22:20+0000] [ALPM] upgraded mpg123 (1.32.7-1 -> 1.32.8-1)
[2024-10-30T22:22:21+0000] [ALPM] upgraded thunderbird (128.3.3-1 -> 128.4.0-1)
[2024-10-30T22:22:21+0000] [ALPM] upgraded webkit2gtk (2.46.2-1 -> 2.46.3-1)
[2024-10-30T22:22:21+0000] [ALPM] upgraded webkit2gtk-4.1 (2.46.2-1 -> 2.46.3-1)
[2024-10-31T13:42:00+0000] [ALPM] removed nextcloud-client (2:3.14.2-2)
[2024-10-31T15:17:32+0000] [ALPM] installed postman-bin (11.18.0-1)

After some investigating and some dumb luck, I found out that when I boot the computer up with the wireless dongle connected, the issue occurs every time the keyboard wakes up, but, if I only plug the dongle with the system up and running, the computer is locked, but after that, every single time the keyboard goes to sleep and I wake it up, it works as intended. So it probably doesn’t have anything to do with the packages I installed or updated, and when I thought it was fixed, I probably forgot about the first lockup, since I was used to the unusual behaviour

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

I ran the script, and it seems like it does make the keyboard work normally. I’m assuming I just need to enable the service now, right?
Come to think of it, sometimes I need to unplug and plug my mouse for it to work after booting up, but I didn’t really think the issues were related, maybe this will fix that too.

Edit 1:
It worked once, I since then rebooted the pc without enabling the service, and both my mouse and keyboard cease to work after running the script.

Edit 2:
After using the script, the system freezes when I reboot

I sincerely apologize if the script I gave you froze your system. Not sure why though, as I’ve used that script many times in the past on a computer with flaky USB support.

Your best alternative is to test out a suspend service, as they are far less likely to cause any serious problems compared to a service run at startup. I have written and used suspend services in the past to disable either the mouse or keyboard at suspend and then re-enable the device at resume.

To do this, you must first find your keyboard’s hardware device ID (with the lsusb command) to insert into the script(s) used in the suspend service.

Running the lsusb command will return a line similar to below.

Bus 007 Device 002: ID 04ca:002f Lite-On Technology Corp.

Your output will likely be on a different bus, but hopefully you can easily figure out exactly which device is your keyboard. Sometimes it may not be immediately apparent which device is your keyboard if the lsusb command returns a rather generic output. In that case perform an internet search using the device ID you suspect is your keyboard to confirm that you have identified the correct device.

The search term “Device ID 04ca:002f Lite-On Technology Corp” returned:

Lite-On Technology Corp. USB Multimedia Keyboard

The above search result 100% confirms the device ID of the keyboard in use. Once you know this information, you can write the script(s) required for a service to disable and enable your keyboard at suspend and resume.


DISABLE/ENABLE USB KEYBOARD SERVICE FILE & SCRIPTS


Directions for writing a service to disable the keyboard at suspend and enable it again at resume.

Create:

/etc/systemd/system/suspend-resume.service

Systemd suspend-resume.service file contents:

#commands to enable/disable, start/stop and check the status of the service

#/etc/systemd/system/suspend-resume.service
#systemctl enable --now suspend-resume.service
#systemctl disable --now suspend-resume.service
#systemctl start suspend-resume.service
#systemctl stop suspend-resume.service
#systemctl daemon-reload
#systemctl status suspend-resume.service

[Unit]
Description=Enable/Disable a USB device at suspend/resume 
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/sbin/suspend.sh
ExecStop=/usr/local/sbin/resume.sh

[Install]
WantedBy=sleep.target



ENABLE/DISABLE USB KEYBOARD BY DEVICE ID SCRIPT(S)



USB KEYBOARD SUSPEND SCRIPT:


Script to disable the USB keyboard at suspend.

Create:

/usr/local/sbin/suspend.sh

Suspend script contents:

#!/bin/bash
#disable keyboard by device ID
set -euo pipefail
IFS=$'\n\t'

VENDOR="05ac"
PRODUCT="0291"

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
  fi
done

Make the script executable:

sudo chmod +x /usr/local/sbin/suspend.sh

In both the suspend and resume scripts you will need to amend the following section:

VENDOR="05ac"
PRODUCT="0291"

In this section of both scripts you will need to substitute the VENDOR and PRODUCT codes of your own keyboard (obtained from the lsusb command).



USB KEYBOARD RESUME SCRIPT:


Script to enable the USB keyboard at resume.

Create:

/usr/local/sbin/resume.sh

Resume script contents:

#!/bin/bash
#enable keyboard by device ID
set -euo pipefail
IFS=$'\n\t'

VENDOR="05ac"
PRODUCT="0291"

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 1 > $DIR/authorized
  fi
done

Make the script executable:

sudo chmod +x /usr/local/sbin/resume.sh

Then issue:

systemctl enable --now suspend-resume.service && systemctl daemon-reload

A restart shouldn’t be required for the service to take effect after running the above commands.

Please post the output of the status command if the service is not working correctly, (after you have completed a few suspend cycles).

Running this service assumes that your mouse can trigger your computer to come out of sleep as the keyboard will be fully disabled during sleep by the service.

1 Like

The problem didn’t go away with this new service

nov 03 00:41:53 rogstrixg513ie systemd[1]: Starting Enable/Disable a USB device at suspend/resume...
nov 03 00:41:53 rogstrixg513ie systemd[1]: Finished Enable/Disable a USB device at suspend/resume.
nov 03 00:41:58 rogstrixg513ie systemd[1]: Stopping Enable/Disable a USB device at suspend/resume...
nov 03 00:41:58 rogstrixg513ie systemd[1]: suspend-resume.service: Deactivated successfully.
nov 03 00:41:58 rogstrixg513ie systemd[1]: Stopped Enable/Disable a USB device at suspend/resume.
nov 03 00:45:22 rogstrixg513ie systemd[1]: Starting Enable/Disable a USB device at suspend/resume...
nov 03 00:45:22 rogstrixg513ie systemd[1]: Finished Enable/Disable a USB device at suspend/resume.
nov 03 00:45:26 rogstrixg513ie systemd[1]: Stopping Enable/Disable a USB device at suspend/resume...
nov 03 00:45:26 rogstrixg513ie systemd[1]: suspend-resume.service: Deactivated successfully.
nov 03 00:45:26 rogstrixg513ie systemd[1]: Stopped Enable/Disable a USB device at suspend/resume.

The keyboard did get disabled when the computer went to sleep. After unlocking the computer, the keyboard starts working, but also has the same problem, where if it sleeps and wakes up it locks the computer.

It may be because I’m a newbie, but I didn’t really feel like this solution was aimed at my problem because in my understanding it needed the computer to go to sleep and then it would disable the keyboard, to then only turn it on again when the pc were awakened, but my problem stems from the keyboard going to and awakening from sleep and not the computer.

@sgs has already tried to persuade you to stop posting excerpts of logs as this is very frustrating for forum helpers. It’s hard to get a full picture of what is happening when you post excerpts. You need to post the command input as well as the full command output.

Example of a proper status command posted on the forum:

$ systemctl status NetworkManager
● NetworkManager.service - Network Manager
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; preset: disabled)
     Active: active (running) since Sat 2024-11-02 06:02:05 PDT; 12h ago
       Docs: man:NetworkManager(8)
   Main PID: 687 (NetworkManager)
      Tasks: 3 (limit: 37618)
     Memory: 13.3M
        CPU: 4.794s
     CGroup: /system.slice/NetworkManager.service
             └─687 /usr/bin/NetworkManager --no-daemon

Nov 02 18:30:18 htpc2 NetworkManager[687]: <info>  [1730597418.9231] dhcp4 (enp5s0f1u3): activation: beginning transac>
Nov 02 18:30:18 htpc2 NetworkManager[687]: <info>  [1730597418.9355] dhcp4 (enp5s0f1u3): state changed new lease, addr>
Nov 02 18:30:18 htpc2 NetworkManager[687]: <info>  [1730597418.9360] policy: set 'Wired connection 2' (enp5s0f1u3) as >
Nov 02 18:30:18 htpc2 NetworkManager[687]: <info>  [1730597418.9421] device (enp5s0f1u3): state change: ip-config -> i>
Nov 02 18:30:18 htpc2 NetworkManager[687]: <info>  [1730597418.9495] device (enp5s0f1u3): state change: ip-check -> se>
Nov 02 18:30:18 htpc2 NetworkManager[687]: <info>  [1730597418.9497] device (enp5s0f1u3): state change: secondaries ->>
Nov 02 18:30:18 htpc2 NetworkManager[687]: <info>  [1730597418.9498] manager: NetworkManager state is now CONNECTED_SI>
Nov 02 18:30:18 htpc2 NetworkManager[687]: <info>  [1730597418.9500] device (enp5s0f1u3): Activation: successful, devi>
Nov 02 18:30:20 htpc2 NetworkManager[687]: <info>  [1730597420.1263] policy: set 'Wired connection 2' (enp5s0f1u3) as >
Nov 02 18:30:20 htpc2 NetworkManager[687]: <info>  [1730597420.3798] manager: NetworkManager state is now CONNECTED_GL>
lines 1-21/21 (END)

What you posted:

nov 03 00:41:53 rogstrixg513ie systemd[1]: Starting Enable/Disable a USB device at suspend/resume...
nov 03 00:41:53 rogstrixg513ie systemd[1]: Finished Enable/Disable a USB device at suspend/resume.
nov 03 00:41:58 rogstrixg513ie systemd[1]: Stopping Enable/Disable a USB device at suspend/resume...
nov 03 00:41:58 rogstrixg513ie systemd[1]: suspend-resume.service: Deactivated successfully.
nov 03 00:41:58 rogstrixg513ie systemd[1]: Stopped Enable/Disable a USB device at suspend/resume.
nov 03 00:45:22 rogstrixg513ie systemd[1]: Starting Enable/Disable a USB device at suspend/resume...
nov 03 00:45:22 rogstrixg513ie systemd[1]: Finished Enable/Disable a USB device at suspend/resume.
nov 03 00:45:26 rogstrixg513ie systemd[1]: Stopping Enable/Disable a USB device at suspend/resume...
nov 03 00:45:26 rogstrixg513ie systemd[1]: suspend-resume.service: Deactivated successfully.
nov 03 00:45:26 rogstrixg513ie systemd[1]: Stopped Enable/Disable a USB device at suspend/resume.

Over half of the important information was missing from your systemctl status suspend-resume.service input and output. I’m not trying to pick nits, but this makes providing support frustratingly difficult.

You also are not doing a great job of providing concise details about what is going on.

Example:

#  │ Type   │ Pre # │ Date                     │ User │ Cleanup │ Description                                                              │ Userdata
───┼────────┼───────┼──────────────────────────┼──────┼─────────┼──────────────────────────────────────────────────────────────────────────┼─────────
0  │ single │       │                          │ root │         │ current                                                                  │
3  │ pre    │       │ qua 30 out 2024 17:44:02 │ root │ number  │ pacman -S --needed discord firefox garuda-wallpapers-extra               │
4  │ post   │     3 │ qua 30 out 2024 17:44:04 │ root │ number  │ firefox garuda-wallpapers-extra                                          │
5  │ pre    │       │ qua 30 out 2024 18:47:32 │ root │ number  │ pacman -R firedragon-extension-plasma-integration firedragon             │
6  │ post   │     5 │ qua 30 out 2024 18:47:34 │ root │ number  │ firedragon firedragon-extension-plasma-integration                       │
7  │ pre    │       │ qua 30 out 2024 22:22:20 │ root │ number  │ pacman -Su                                                               │
8  │ post   │     7 │ qua 30 out 2024 22:22:23 │ root │ number  │ intel-media-driver mhwd-nvidia mpg123 thunderbird webkit2gtk webkit2gtk- │
9  │ pre    │       │ qui 31 out 2024 13:42:00 │ root │ number  │ pacman -R nextcloud-client                                               │
10 │ post   │     9 │ qui 31 out 2024 13:42:03 │ root │ number  │ nextcloud-client                                                         │
11 │ pre    │       │ qui 31 out 2024 15:17:26 │ root │ number  │ pacman -S postman                                                        │
12 │ post   │    11 │ qui 31 out 2024 15:17:35 │ root │ number  │ postman-bin                                                              │

That is another small excerpt of your pacman logs that is very unhelpful.

Please post the output of @SGS 's first command above so that we can see your install history.

If you just reinstalled your system your pacman logs should be minor in size. If you can pinpoint the date/ time your issue began we may be able to have a better idea of what’s causing this.

Unlikely.

It is far more likely that an upgrade to the kernel or an important system package might have caused your issue. The packages you listed as your recent installs are not likely to be the cause of your problem IMO.

Also, IMO you have not done a very good job of describing what is happening when you resume.

When you are locked out of yours system does your keyboard function properly?

Can you type your password into the password field when you are locked out, but the password doesn’t unlock the computer when entered?

If the keyboard seems unresponsive do your CAPS lock and NUM lock keys LED’s light up?

If your CAPS lock and NUM lock keys are working, can you get to a TTY by pressing the keys CTRL+ ALT+F2 ? If so, try logging in to your user account and see if your login is accepted. If you can login then enter systemctl --user restart plasma-plasmashell.service . See what happens if you press CTRL+ ALT+F1.

I realize English is not likely your first language, but please try your best to provide as much feedback as possible in order to help us help you.

2 Likes

I’m sorry for the way I posted the results of the different commands, I was trying to only share the information I thought was important.

How I reproduce the problem:

  1. The computer is up and running

  2. I wait for my keyboard to go to sleep for being idle, the computer remains up and running

  3. I press any key on the keyboard, this causes the computer to go into sleep mode.

  4. After this, the computer can be woken up normally and I can input my password.

I tried using the linux-lts kernel but the problem was still present.
I also tried a different distro, DraugerOS which is based on Ubuntu, and the problem was present there too.

Insight I believe to be important:

  • When I boot up the system with the keyboard’s dongle already plugged in, the issue usually recurs.

  • If I plug in the dongle after the system has started, the issue initially appears but tends to not repeat itself afterward.

The log’s output is really large now, and the forum has a character limit, so I can’t paste it here, nor can I upload a file with it because only images are supported.

I believe some of the changes on the log were rolled back by snapshots but are still appearing on the log, I don’t really know what to do about that.

I have just installed the garuda on another system and the problem occurs even before updating.

╭─joaod@eagleTowerRowr in ~
╰─λ cat /var/log/pacman.log | grep -E 'installed|upgraded|removed'
[2024-11-03T17:11:04+0000] [ALPM] installed nvidia-utils (550.76-3)
[2024-11-03T17:11:04+0000] [ALPM] installed eglexternalplatform (1.1-2)
[2024-11-03T17:11:04+0000] [ALPM] installed egl-wayland (2:1.1.13-1)
[2024-11-03T17:11:04+0000] [ALPM] installed python-markupsafe (2.1.5-2)
[2024-11-03T17:11:04+0000] [ALPM] installed python-mako (1.3.3-2)
[2024-11-03T17:11:05+0000] [ALPM] installed gobject-introspection (1.80.1-3)
[2024-11-03T17:11:05+0000] [ALPM] installed libdazzle (3.44.0-1)
[2024-11-03T17:11:05+0000] [ALPM] installed python-injector (0.21.0-1.1)
[2024-11-03T17:11:05+0000] [ALPM] installed python-peewee (3.17.1-2)
[2024-11-03T17:11:05+0000] [ALPM] installed python-py3nvml (0.2.7-1.4)
[2024-11-03T17:11:05+0000] [ALPM] installed python-xlib (0.33-3)
[2024-11-03T17:11:05+0000] [ALPM] installed python-pyxdg (0.28-3)
[2024-11-03T17:11:05+0000] [ALPM] installed python-reactivex (4.0.4-4)
[2024-11-03T17:11:05+0000] [ALPM] installed gwe (0.15.7-1.1)
[2024-11-03T17:11:05+0000] [ALPM] installed libxnvctrl (550.67-1)
[2024-11-03T17:11:05+0000] [ALPM] installed nvidia-settings (550.67-1)
[2024-11-03T17:11:05+0000] [ALPM] installed opencl-nvidia (550.76-3)
[2024-11-03T17:11:05+0000] [ALPM] installed lib32-nvidia-utils (550.76-1)
[2024-11-03T17:11:05+0000] [ALPM] installed lib32-opencl-nvidia (550.76-1)
[2024-11-03T17:11:05+0000] [ALPM] installed dkms (3.0.12-1)
[2024-11-03T17:11:05+0000] [ALPM] installed nvidia-dkms (550.76-3)
[2024-11-03T17:11:05+0000] [ALPM] installed garuda-nvidia-config (2:1.1.6-1)
[2024-11-03T17:12:54+0000] [ALPM] removed intel-ucode (20240312-1)
[2024-11-03T17:14:56+0000] [ALPM] upgraded archlinux-keyring (20240313-1 -> 20241015-1)
[2024-11-03T17:17:50+0000] [ALPM] upgraded garuda-update (4.8.0-1 -> 4.8.2-1)

For large logs, you can use our PrivateBin at https://bin.garudalinux.org/

4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.