Suspend in the power menu for Linux Mint, can it be configured to respond to just one key of the keyboard?

Can the suspend option in the Linux Mint power off menu be configured so as to respond to a specific key on the keyboard in order to re-engage the system to power on state?
The reason I ask this question is that I use and find the suspend option in the power menu really useful until I accidentally press a key on the keyboard thus starting the system to full power up state, this is easy to do when there’s such a large area of key’s that can be pressed.

On my keyboard the Function key and F3 key, which has a picture of a moon in red suspends my computer and annoyingly it’s any key on the keyboard to wake it back up. There does not seem to be an easy way to change this, as it’s written to Systemd and all I found was at least for me was confusing jargon about finding what USB device is enabled to “SUSPEND” the computer. Now this could range from wireless devices, to USB keyboards. The only ending result was only to switch off suspend altogether, no choice to configure, but I will look deeper into this and see what I can find for you, I’m not one to give up.

1 Like

Thank you for your reply, it seems to me that a successful resolution to this issue might be useful to a lot of user of Linux and I am quite surprised to find it so hard to find any answers thus far.
We will keep looking, I am also not one to give up easily.

I can sympathize with your problem. I have a dedicated key on my wireless keyboard that activates suspension mode, but when I took the keyboard off of the bed or my lap I would sometimes jiggle a key accidentally or I would drop the tv remote or eyeglasses onto the keyboard and then cringe when I heard the computer firing back up.

After many such instances, I finally wised up and simply turnoff the keyboard switch manually after entering suspension.

Not a high tech solution, but it’s been working perfectly for me.


1 Like

Yes, I can see how that works for you.
I want to go much deeper though, it seems to me that if the systemd or whatever is looking at the keyboard during suspended state can detect any key being pressed in order to repower up the system; that it could just as easily look for just one key set by the user to archive the same result.
I can’t understand why this isn’t already a thing for Linux in general!

I have scoured the Internet for a solution to add a keyboard shortcut to awaken computer, instead of any key being pressed. I think the answer is, is that Systemd has it written into it’s very core to be awoken by pressing any key on the keyboard. I have even searched for the script in my file system and the amount of different scripts I have found under suspend is mind boggling, pictures below.



With Suspend it’s written to the Kernel and I think Awaken is too.
I will go through every file and see if I can come up with something.

1 Like

I’ve resorted to suspending my main “home” laptop (Dell E7270 running poobuntu 20.04) overnight - to avoid the scenario where the keyboard / cursor / mouse / trackpad goes berserk in the right hand upper part of the sceen - haven’t found a hardware solution to this hardware issue (it happens even in the GUI / BIOS : short term fix to stop it - is to wake it from suspend each morning) other than buying a complete replacement keyboard and palmrest and trackpad off e-bay - which looks to be about 6 hours of work to replace - so I’ve chucked that into the “coombie” (couldn’t be arsed) basket…**

Anyway - you prompted me to find the dinky little script I wrote yonks ago to do suspend - so I don’t have to poke around in the system tray to suspend :

╭─x@titan ~/bin  ‹master*› 
╰─➤  cat ooroo                                                                                                     
#!/usr/bin/env bash
# send the 'puter to sleep :
sudo systemctl suspend

Probably not much use in your scenario… but thanks for the reminder / prompting - cheers ! - I’ll be doing it from an xterm from now on… I guess I can probably even do it remotely…

Been tossing up buying a new / old E7270 off e-bay - but I don’t want to perform brain surgery - and I definitely want an i7… they’re good laptops over-all - supports DDR4 so I can bump this sucker up from 16 GB to 32 GB… but then I look at the price of the E7270’s on e-bay - and I could maybe even get an XPS for around that price - but there’s so many XPS models to choose from - wouldn’t know where to start… I’m “heavily” invested in Dell laptops - got power bricks and docking stations all over the place, including at work…


That’s the problem for a lot of Laptops, my Lenovo Yoga 500 jumps everywhere and so resorted to using a USB mouse, switched off the trackpad altogether. It’s apparently to do with vibration, even in suspend mode, fans are still slightly spinning, causing the trackpad to even when writing on forums or emails, to jumble the letters up of the word you’ve just typed.

Even in Windows it done the same and I swear it’s to do with vibration, from the fans spinning. I have searched for a solution for a keyboard shortcut script to wake computer up, instead of any keyboard button being pushed. Me personally shutdown my computers completely.

I think it is set in stone on whatever Operating System Windows, Linux, Mac for any keyboard key to wake up. Where it is written to the Kernel and if you have more than one Kernel on your drive, recommended two Kernels in 64bit computer anyway. Then it is going to be hard to write a script for it, let alone go through thousands of lines of script to find what will probably be jargon that is not readable anyway, to someone like myself who has used Linux for years, but does not understand the coding side of it.

I recently got my HP EliteBook back off my brother, he borrowed it I put Peppermint 10 Respin on it for him and then he went out and got himself a Laptop, which has a bigger screen on it, but only 4GB of Ram, where as I upgraded the EliteBook to 8GB of Ram and it still has the original SSD of 90GB inside it. Blooming heavy as it has a DVD player attached, battery is the size of three house bricks joined up length ways in a row. Elitebook 2540p, it has HDMI, VGA inputs on it, micro card reader for seeing pictures off your camera, click the link above in blue for full specs. I love it can’t go wrong with it.

1 Like

I have the I7 version, it’s faster than my Gaming ASUS laptop, that has 32GB of Ram inside it.

1 Like

I think the difficulty with your issue involves the fact that resume-from-suspend is controlled at several levels. On my Dell 5721, keypresses don’t wake my laptop from suspend – I tap the hardware ON/OFF button to do that. This may be a longshot, but try restarting and enter Setup Mode to look at your BIOS/UEFI settings. There may be a Wake-On-Lan option. This option affected my network connection on resume-from-suspend, and it may affect your resume on keypress behavior. In my case, my disabled network on resume was caused by a setting in TLP (a power saving tool) which I recently installed, and fixed in TLP config. But you might find your solution in the hardware setting. Just a suggestion. Of course YMMV. Good luck.

1 Like

Interesting :

  1. if I use the power menu in the system tray (Power Off / Log Out") on Ubuntu 20.04 to suspend - just about anything will wake it up - most keys on the keypoard, click either mouse button on the trackpad…
  2. if I put it to sleep with “sudo systemctl suspend” - only the power button will resume it…
1 Like

Wow! thanks, you really have gone into this, I hope it’s not taking you away from other stuff that you want to be doing, thanks

Thank you, I am grateful for your input, who knows at some stage if enough people look into this it will come to the notice of the Ubuntu team who hopefully will make it easier on all of us and include some more comprehensive power management options.

Got to love them old computers, they made some of them a lot more adaptable that what we get now.

Indeed they did, especially ones with DVD/CD drives. Now manufacturers make them without because of digital downloads and of course YouTube, BBC_iPlayer, Netflix, all the channels you can think of online.

You’re welcome I’m just sorry I could not be of any more help. I’m either working, relaxing in front of my computer on my days off. I love my computers.
I have way too many, some need fixing, with motherboards dating back to the stone age, some need rebuilding into newer cases. I’m a Desktop fan not the one that’s inside spinning round all day long, but a fan of. :grin:

The only problem with everything going on in the world, is getting hold of computer parts, as the scalpers have cleared the shelves, trying to make money out of their parts. Cars need these chips now too and millions of people round the world are after the latest graphic cards, stuck in queues dating back to last September.

It looks like they won’t be back to normal till way into next year, as they are building factories to manufacture Silicon components in. Linux may not be so big on the Desktop or Laptop, but in cars, fridges, tumble dryers, washing machines it’s all controlled by Linux.

My Renault Scenic 2009 car has GTK2 animated dashboard, electric windows, alarms that go off if there is a speed camera coming, but that only works if you have the stereo on, the same with the GPS that we never use. If you’re going on holiday, plan your route first with a good old fashioned map, any road works, then plan alternative route. Now the world is getting ready for electric vehicles, don’t even get me started on the coal or what they intend to use to make electricity to charge the vehicles up with, as electric vehicles are supposed to be better for the planet, but we are running out of natural resources to produce electric anyway, plus the fact what they burn into the atmosphere already to make electric is polluting the planet anyway.

By next year we are meant to be told that the governments of the world already know about and have been working and living with Aliens amongst us for generations. So unless these aliens are going to give us all some other way to charge our vehicles, still remains a mystery.