I am using GNOME 3.36.6 on Arch Linux. By default, GNOME's automatic suspend option is enabled and it works as expected. However, I have to press the power button to wake the computer from suspend. I want to use my USB keyboard, which works by default on Windows.

The Linux kernel documentation describes how /sys/devices/.../power/wakeup files control whether or not a device is supposed to signal system wakeup. According to the documentation:

The initial value in the power/wakeup file is “disabled” for the majority of devices; the major exceptions are power buttons, keyboards, and Ethernet adapters whose WoL (wake-on-LAN) feature has been set up with ethtool.

This is not the case on my system. When I run grep . /sys/bus/usb/devices/*/power/wakeup, I can see that wakeup is disabled for all USB devices. I found the question Wake up from suspend using wireless USB keyboard or mouse (for any Linux Distro) on the Ubuntu Stack Exchange, which explains how to identify the correct device in /sys/bus/usb/devices and use /etc/rc.local to apply the correct configuration on boot.

All of this seems pretty complicated, difficult to remember, and error-prone. Using /etc/rc.local is discouraged on systemd-based distributions like Debian, Ubuntu, Arch and Fedora. Researching this problem turns up lots of outdated advice (systemd became Debian's default init system in 2015), as well as questions about suspend itself being broken over the years. As of 2020, GNOME seems to lack user-friendly configuration for wake-on-USB; on Windows, this is accessible from the Power Management tab of the device's hardware properties.

What is the simplest and most reliable way to enable wakeup for a specific USB keyboard or mouse, on a modern systemd-based Linux distribution?

(The Arch Linux Wiki page on suspend and hibernate suggests that the answer is probably to automatically configure the appropriate /sys/devices/.../power/wakeup file using systemd-tmpfiles, but identifying a graphical or simple command line tool that makes it easy to select the correct USB device, and is packaged in popular distributions, would be even better.)

See also


Write the

 echo enabled > /sys/bus/usb/devices/usb1/power/wakeup
 echo enabled > /sys/bus/usb/devices/usb2/power/wakeup

part of Ask Ubuntu in a script and try it adding it in crontab for root.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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