0

My Ubuntu 22.04 by default wakes from "Sleep" mode with any key or mouse move or click (both wired and wireless devices). I would prefer it to wake if only a key sequence was entered and not by accidental mouse movement or keypress.

It is a desktop with B550M Aorus Pro-P motherboard.

How could I do this?

EDIT: In this question, uglic's answer and the script written by Bart van Oort helped me disable waking via all my input devices but a single keyboard. The question remaining is how can I prevent turning on the PC by accidental key presses.

John
  • 723
  • Please be more specific than "how can I prevent my cat". Also, it can't be a multi-key sequence. The wakeup is handled by your BIOS and most of them only care about waking up the computer by any event coming from the devices you want. You would need a special firmware to listen for key sequences – Daniel T Mar 03 '24 at 02:38
  • I am asking about a key sequence (at least two specific key strokes). With the cat thing I mean that an accidental key pressed on the keyboard should not power up the PC. – John Mar 03 '24 at 02:44
  • 1
    No, that does not seem possible. You need special motherboard or keyboard firmware – Daniel T Mar 03 '24 at 02:44

1 Answers1

1

How to wake my Ubuntu from sleep with a keyboard key sequence (not a single key press)?

Impossible from within the operating system. Wake on Keyboard is done by hardware (motherboard, ACPI) so You are limited to what your BIOS offers. Check your BIOS for the possible options but it is likely 1 key (any key on the keyboard, or just the spacebar, or ESC (maybe that one is a option? it is more difficult to hit).

If not you need to find another solution. For instance: do not use suspend but hibernate. Hibernate needs the 'power on' button to wake up. Or put the keyboard at a location the cat can't get to it: there are desks where you put the keyboard under the desk and slide it in and out.

Rinzwind
  • 299,756
  • I tend to agree that it is a bios feature. On the other hand, how do operating system's settings affect bios' behavior? For example, following uglic's answer in the question https://askubuntu.com/questions/1328823/disable-specific-device-from-waking-up-the-system/1359890#1359890, I could disable specific devices for waking the PC. No bios settings were tweaked there. – John Mar 03 '24 at 09:49
  • you can disable a device to not discharge a current. that does not require your bios. it is something different than changing the keys pressed to wake up ;) – Rinzwind Mar 03 '24 at 11:28