4

Can I resume Ubuntu after suspend by shortcut from keyboard?

I have a docking station with thinkpad and an external monitor. My laptop is always closed, so I need to open it and close again to resume system, it's annoying.

guntbert
  • 12,914
  • 37
  • 45
  • 86
mystdeim
  • 399
  • 5
  • 12

1 Answers1

1

If the external keyboard is USB, you probably can, although it depends on your motherboard.

Check /proc/acpi/wakeup it shows all supported wakeup sources and their states. To toggle the state, simply echo the wakeupsource name back to the same file.

Example, to enable/disable wakeup from a usb device on my system, i do:

# cat /proc/acpi/wakeup |grep HC
EHC1      S4    *disabled  pci:0000:00:1d.0
EHC2      S4    *disabled  pci:0000:00:1a.0
XHC   S4    *disabled  pci:0000:00:14.0
# echo XHC > /proc/acpi/wakeup 
# cat /proc/acpi/wakeup |grep HC
EHC1      S4    *disabled  pci:0000:00:1d.0
EHC2      S4    *disabled  pci:0000:00:1a.0
XHC   S4    *enabled   pci:0000:00:14.0
# 
Daniel
  • 558
  • 2
  • 10
  • this command gives me 49 entries. How do I know what `EHC1`, `EHC2` or `XHC` is and what device this belongs to? Why can this command not simply say "External Samsung mouse" or "Built-in keyboard" instead? – phil294 Aug 20 '23 at 02:02
  • another question, how do these entries relate to BIOS-settings? I can configure wake-on-lan or lid-close suspend behavior there - does `acpi` overwrite my bios? And a third question, how do you make these changes permanent? – phil294 Aug 20 '23 at 02:03