Suspend command keyboard shortcut  [Solved]

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
PaulR
Posts: 155
Joined: Tue Jan 21, 2020 4:27 am

Re: Suspend command keyboard shortcut

#21 Post by PaulR »

PaulR wrote: Tue Sep 12, 2023 9:21 am
Charlie Brown wrote: Mon Sep 11, 2023 3:33 pm You can try this first in a terminal, in case of success change your hotkey etc..

Code: Select all

sudo sh -c 'echo mem > /sys/power/state'
That suspends the system instantly but I can only wake it up using the power button, the keyboard is 'dead'. I wouldn't mind that though provided it works consistently. I'll hook it up to the hotkey and see how it goes.

Thanks again Charlie Brown!
Hmm, for some reason that doesn't work when the command is bound to a shortcut key. I'll try the other suggestion... sudo 'pm-suspend'

User avatar
siamhie
Global Moderator
Posts: 3723
Joined: Fri Aug 20, 2021 5:45 pm

Re: Suspend command keyboard shortcut

#22 Post by siamhie »

@PaulR I'm not sure why it's not working for you. I created a shortcut on a new MX-23 XFCE install and it works.

suspend.png
You do not have the required permissions to view the files attached to this post.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

Charlie Brown

Re: Suspend command keyboard shortcut

#23 Post by Charlie Brown »

I guess you're using either a wireless or a usb keyboard (I wish you could try with an older PS/2 connection).

At least out of curiosity (and it may be a good feedback for devs) you can try all of these when booted with systemd , and especially

Code: Select all

systemctl suspend
there.

Charlie Brown

Re: Suspend command keyboard shortcut

#24 Post by Charlie Brown »

... You can even try:

Code: Select all

sudo pm-hibernate

Code: Select all

sudo pm-suspend-hybrid
(the hybrid one does them together: either to ram and to disk)

PaulR
Posts: 155
Joined: Tue Jan 21, 2020 4:27 am

Re: Suspend command keyboard shortcut

#25 Post by PaulR »

@siamhie It's always worked ok in the past, just this last few weeks it's been acting up.
@Charlie Brown It's a USB keyboard, I've been using the same one for maybe 3 or 4 years.

It worked faultlessly all day yesterday using

Code: Select all

sudo 'pm-suspend'
but first time I tried it today the problem recurred - mouse cursor frozen and keyboard inoperable. The power button brought up the log out dialog but I couldn't choose any of the options so it was a case of holding in the power button to turn off.

I've decided to change tack: I've removed the shortcut and will use the power button to suspend instead... I just need to get used to that after years of pressing the [Pause] key!

User avatar
siamhie
Global Moderator
Posts: 3723
Joined: Fri Aug 20, 2021 5:45 pm

Re: Suspend command keyboard shortcut

#26 Post by siamhie »

PaulR wrote: Thu Sep 14, 2023 2:33 am @siamhie It's always worked ok in the past, just this last few weeks it's been acting up.

It worked faultlessly all day yesterday using

Code: Select all

sudo 'pm-suspend'
but first time I tried it today the problem recurred - mouse cursor frozen and keyboard inoperable. The power button brought up the log out dialog but I couldn't choose any of the options so it was a case of holding in the power button to turn off.

@PaulR Try this. Create another user account (MX User Manager) and see if you can replicate the issue.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

PaulR
Posts: 155
Joined: Tue Jan 21, 2020 4:27 am

Re: Suspend command keyboard shortcut

#27 Post by PaulR »

siamhie wrote: Thu Sep 14, 2023 11:20 am @PaulR Try this. Create another user account (MX User Manager) and see if you can replicate the issue.
Thanks for the suggestion but it isn't really practical; since the problem is intermittent I'd have to be logged in as that user for possibly a day or more at a time to see if it recurs and I have stuff to do in my usual account.

PaulR
Posts: 155
Joined: Tue Jan 21, 2020 4:27 am

Re: Suspend command keyboard shortcut

#28 Post by PaulR »

Using the power button for suspend has worked for three days without fault. However, I just pressed it, the screen blanked then came back on after a short pause and the mouse and keyboard were inoperable. Maybe I should try MX23.

Charlie Brown

Re: Suspend command keyboard shortcut

#29 Post by Charlie Brown »

Nothing to lose to try post #4 and it takes just a few minutes since it's a desktop (though the problem is just when suspending). Of course the rest is up to you.

PaulR
Posts: 155
Joined: Tue Jan 21, 2020 4:27 am

Re: Suspend command keyboard shortcut

#30 Post by PaulR »

Charlie Brown wrote: Sun Sep 17, 2023 5:49 am Nothing to lose to try post #4 and it takes just a few minutes since it's a desktop (though the problem is just when suspending). Of course the rest is up to you.
Checked this, all seems ok.

I've switched to a wireless mouse rather than the USB one I was using. Now when I press the power button to suspend, the screen blanks for a very short time then comes back on as per post #28. However, the wireless mouse continues to work but the keyboard is inoperable - very confusing. I wonder if it's possible to suspend from a live USB so I could try MX23 or some other distro to see what happens...?

Post Reply

Return to “MX Help”