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.

-Edgrin2

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.

Suspend

Awaken

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.

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…

1 Like

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.

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

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.