Let a USB keyboard or mouse wake the machine from suspend
The udev rule matches the Udev wiki's 'Waking from suspend with USB device' section and the lsusb/grep idProduct method is the wiki's. Two defects in the fix. sudo udevadm trigger --subsystem-match=usb sends change events by default (man udevadm on this machine: 'The default value is "change"'), and the rule matches only ACTION=="add", so the immediate apply does nothing until a replug or reboot. It needs --action=add. Second, the record checks only the device and the ACPI controller entry, but the hubs and root hub in between also carry power/wakeup, and on this workstation /sys/bus/usb/devices/usb1/power/wakeup reads disabled. A disabled root hub stops remote wake for every device on it, so the fix now walks the whole chain. The cause's 'many devices default to disabled' was imprecise: usbhid enables wake by default on boot-protocol keyboards, while most mice stay disabled. Omarchy 4 ships no USB wakeup configuration (searched /usr/share/omarchy, only the T2 Mac installer touches xhci). Not exercised: no rule written and no suspend performed here.
Enabling wake on a mouse means bumping the desk can wake the machine, and enabling wake on hubs lets any device behind them wake it too, which can bring back spurious wakeups. Do not toggle /proc/acpi/wakeup entries blindly: writing a name there toggles it, so a second write undoes the first.
Symptom
After suspend, pressing keys on my USB keyboard or moving the mouse does nothing. Only the power button wakes the PC. On Windows the keyboard woke it.
Cause
A USB device can wake the system only if wakeup is enabled at every level of its path: the device's own power/wakeup, each hub between it and the controller, the root hub (/sys/bus/usb/devices/usbN/power/wakeup), and the host controller (its /proc/acpi/wakeup entry, such as XHC). The kernel enables wakeup by default on USB keyboards that use the boot protocol, but not on most mice, and a root hub can read disabled. An earlier fix for spurious wakeups that disabled the XHC controller or a root hub turns off wake for every device behind it. On desktops the firmware must also allow USB wake, and an ErP or EuP setting that cuts standby power stops it.
Fix
**1. Find the device and check every level of its path:**
grep -E '^(XHC|XHC0|XHC1|EHC)' /proc/acpi/wakeup
lsusb # note the ID, e.g. 046d:c52b
grep -l c52b /sys/bus/usb/devices/*/idProduct
# use the directory the grep printed, e.g. 1-1.1.1.4
d=$(readlink -f /sys/bus/usb/devices/1-1.1.1.4)
while [[ $d != /sys/devices ]]; do
[[ -f $d/power/wakeup ]] && echo "$(cat "$d/power/wakeup") $d"
d=$(dirname "$d")
done
The loop prints the device, any hubs, the root hub (usbN) and the PCI controller. Every line must read enabled for the device to wake the machine.
**2. Enable wake on the device persistently** with a udev rule, using your own vendor and product IDs:
# /etc/udev/rules.d/50-wake-on-device.rules
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c52b", ATTR{power/wakeup}="enabled"
If step 1 showed a hub or the root hub as disabled, add a second line to the same file that enables wake on USB hubs (device class 09):
ACTION=="add", SUBSYSTEM=="usb", ATTR{bDeviceClass}=="09", ATTR{power/wakeup}="enabled"
Apply the rules now. The rules match add, and udevadm trigger sends change unless told otherwise:
sudo udevadm control --reload-rules
sudo udevadm trigger --action=add --subsystem-match=usb
Then rerun the loop from step 1.
**3. If the controller reads *disabled** in /proc/acpi/wakeup and you did not disable it on purpose, look for a rule or unit that did (grep -r wakeup /etc/udev/rules.d /etc/systemd/system). If you disabled it to stop instant wakeups, keep it off and accept power-button wake, or disable only the offending device instead (see suspend-instant-wake-usb-controller).
**4. In the firmware setup** enable "USB wake" or "Wake from S3 by USB" and disable ErP or EuP.
Verify
After a reboot, the loop from step 1 prints enabled on every line for the keyboard or mouse, and a key press wakes the machine from systemctl suspend.