You are not logged in.
Hello.
Is there a way to wakeup my system from suspend by pressing a specific key and not any key on my usb keyboard?
To be more specific, the keyboard doesn't have any sleep or power button and I suspend my system with
systemctl suspend
Last edited by alex.theoto (2017-07-03 17:22:07)
Offline
Short story: no
Long story: Hack the firmware of the keyboard to detect a suspend and only send an event to the computer if you press a specific key. (this is afaik how mediacenter remotes does it), or hack the firmware of the motherboard.
Edit: could also solve it with a hardware mitm device.
Last edited by Mr.Elendig (2017-07-02 09:07:10)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
This sounds like an xy problem. Why do you want to limit the feature to a specific key itfp?
Offline
I want to use a specific key because my kids (cats) accidentally press one key and the system wakeup without knowing at random times.
Actually, the computer is a laptop but the only functional part is the motherboard which is screwed on a piece of wood.
Power button is not easy to press and the keyboard and mouse are wired on usb.
Offline
What if you deactivate keyboard and mouse altogether and eg. open a second or third hub (if present) to resume by plugging eg. a usb key (no, it will react to any key and even another keyboard being plugged ;-)
See /proc/acpi/wakeup
Offline
cat /proc/acpi/wakeup
Device S-state Status Sysfs node
AZAL S3 *disabled pci:0000:00:1b.0
P0P1 S4 *disabled pci:0000:00:1e.0
EHC1 S3 *enabled pci:0000:00:1d.0
USB1 S3 *disabled
USB2 S3 *disabled
USB3 S3 *disabled
USB4 S3 *disabled
USB5 S3 *disabled
USB6 S3 *disabled
USB7 S3 *disabled
RP01 S4 *disabled pci:0000:00:1c.0
PEG5 S4 *disabled
I found this thread and I decided to wake up my system only from power button.
I created thread's bash script at /usr/lib/systemd/scripts/ chmod into executable but when I reboot, EHC1 is still enabled. If I run the script from terminal, EHC1 changes into disabled.
Do I have to enable something on systemd to activate this script?
Thank you.
Offline
Those scripts are not magically executed (when?) but the location is usable to services rediding in /usr/lib/systemd/system (you could also put them into /usr/bin, but then they'd end up in a path)
=> you'll have to eg. add a oneshot service that calls your "script" (or just put the call there - "ExecStart=/bin/sh -c '...'" is a fairly common pattern) and either enable or "want" it.
Offline
Thank you very much.
I created a unit described on my previous link and everything works fine.
Problem solved.
Offline