Page 3 of 4

Re: Suspend command keyboard shortcut

Posted: Tue Sep 12, 2023 9:25 am
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'

Re: Suspend command keyboard shortcut

Posted: Tue Sep 12, 2023 1:33 pm
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

Re: Suspend command keyboard shortcut

Posted: Tue Sep 12, 2023 1:34 pm
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.

Re: Suspend command keyboard shortcut

Posted: Tue Sep 12, 2023 1:39 pm
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)

Re: Suspend command keyboard shortcut

Posted: Thu Sep 14, 2023 2:33 am
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!

Re: Suspend command keyboard shortcut

Posted: Thu Sep 14, 2023 11:20 am
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.

Re: Suspend command keyboard shortcut

Posted: Fri Sep 15, 2023 3:28 am
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.

Re: Suspend command keyboard shortcut

Posted: Sun Sep 17, 2023 5:01 am
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.

Re: Suspend command keyboard shortcut

Posted: Sun Sep 17, 2023 5:49 am
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.

Re: Suspend command keyboard shortcut

Posted: Tue Sep 19, 2023 10:17 am
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...?