One of the things that would always irritate me, with Linux, was the fact that I could not resume my machine by hitting a key on the keyboard. When I first searched for an answer, to this issue, many of the replies stated “look for an option in the BIOS.” To my dismay, I had no such option in the BIOS. After more searching I found /proc/acpi/wakeup!
/proc/acpi/wakeup looks like this:
Device S-state Status Sysfs node UAR1 S4 disabled pnp:00:08 SMB0 S4 disabled pci:0000:00:01.1 USB0 S4 disabled pci:0000:00:02.0 USB2 S4 disabled pci:0000:00:02.1 US15 S4 disabled pci:0000:00:04.0 US12 S4 disabled pci:0000:00:04.1 NMAC S5 disabled pci:0000:00:0a.0 P0P1 S4 disabled pci:0000:00:08.0 HDAC S4 disabled MXR0 S4 disabled pci:0000:00:10.0 BR11 S4 disabled BR12 S4 disabled pci:0000:00:12.0 BR13 S4 disabled BR14 S4 disabled BR15 S4 disabled BR16 S4 disabled BR17 S4 disabled
Now this might be confusing, at first, but do not fear! We are interested in only two types of devices: USB and US
USB0 S4 disabled pci:0000:00:02.0 USB2 S4 disabled pci:0000:00:02.1 US15 S4 disabled pci:0000:00:04.0 US12 S4 disabled pci:0000:00:04.1
To figure out which device is which take the number after pci: and run grep on dmesg. Example for US15: dmesg | grep 0000:00:04.0
You will likely get a lot of output… you should look for something similar (Note: this differs by hardware, it likely won’t be the same)
[ 6.164097] usb usb4: SerialNumber: 0000:00:04.0 [ 7.284302] input: BTC USB Multimedia Keyboard as /devices/pci0000:00/0000:00:04.0/usb4/4-3/4-3:1.0/input/input2 [ 7.284363] generic-usb 0003:046D:C312.0001: input,hidraw0: USB HID v1.10 Keyboard [BTC USB Multimedia Keyboard] on usb-0000:00:04.0-3/input0 [ 7.300110] input: BTC USB Multimedia Keyboard as /devices/pci0000:00/0000:00:04.0/usb4/4-3/4-3:1.1/input/input3 [ 7.300287] generic-usb 0003:046D:C312.0002: input,hiddev96,hidraw1: USB HID v1.10 Device [BTC USB Multimedia Keyboard] on usb-0000:00:04.0-3/input1
As you can see US15 is my USB keyboard so I will simply run echo "US15" > /proc/acpi/wakeup to allow US15 to wake up the computer.
USB0 S4 disabled pci:0000:00:02.0 USB2 S4 disabled pci:0000:00:02.1 US15 S4 enabled pci:0000:00:04.0 US12 S4 disabled pci:0000:00:04.1
If it is not appearant which devices are which there is always the trial and error process. Enable one, see if the desired device wakes up the machine and if it doesn’t, disable the device (by executing the echo command again) and try another.
Lastly just add the echo command to your startup script. On Arch /etc/rc.local is a good place.