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.)
/proc/acpi/wakeuptweaks to enable mousepad and USB to wake up from suspend: bug logged against Ubuntu's
gnome-power-managerpackage in 2007
/proc/acpi/wakeup: thread on ubuntuforums.org dating back to 2008
How do I make Ubuntu resume from suspend mode by pressing a key on the keyboard?: unanswered Ubuntu-specific question on superuser.com from 2010
How do I make changes to
/proc/acpi/wakeuppermanent?: question on Ubuntu Stack Exchange dating back to 2012