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

Suspend command keyboard shortcut

#1 Post by PaulR »

I've had a keyboard shortcut set up (on the [Pause] key) for years and find it really useful. When I updated to MX21 I couldn't remember the command so copied this from somewhere (maybe here on the forum) but I seem to recall it was slightly different in previous versions

sudo pm-suspend

For some reason it's become temperamental and sometimes freezes the entire machine instead of going to suspend. I haven't changed any hardware or made any major system changes. Is this the right command to use?

TIA

Paul
PS I don't understand why that command has ever worked given that it never asks for a password!


Code: Select all

System:    Kernel: 6.1.0-10mx-ahs-amd64 [6.1.38-1~mx21+1] x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-10mx-ahs-amd64 root=UUID=<filter> ro quiet 
           splash 
           Desktop: Xfce 4.18.1 tk: Gtk 3.24.24 info: xfce4-panel wm: xfwm 4.18.0 vt: 7 
           dm: LightDM 1.26.0 Distro: MX-21.3_ahs_x64 Wildflower April 9  2022 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Desktop Mobo: ASRock model: B450M-HDV R4.0 serial: <filter> 
           UEFI-[Legacy]: American Megatrends v: P3.20 date: 07/31/2019 
CPU:       Info: 6-Core model: AMD Ryzen 5 2600 bits: 64 type: MT MCP arch: Zen+ family: 17 (23) 
           model-id: 8 stepping: 2 microcode: 800820D cache: L2: 3 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 81433 
           Speed: 1411 MHz min/max: 1550/3400 MHz boost: enabled Core speeds (MHz): 1: 1411 
           2: 1472 3: 1550 4: 1550 5: 2355 6: 1550 7: 1550 8: 1550 9: 1550 10: 1550 11: 1550 
           12: 1550 
           Vulnerabilities: Type: itlb_multihit status: Not affected 
           Type: l1tf status: Not affected 
           Type: mds status: Not affected 
           Type: meltdown status: Not affected 
           Type: mmio_stale_data status: Not affected 
           Type: retbleed mitigation: untrained return thunk; SMT vulnerable 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, STIBP: disabled, RSB 
           filling, PBRSB-eIBRS: Not affected 
           Type: srbds status: Not affected 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] vendor: XFX Pine 
           driver: amdgpu v: kernel bus-ID: 08:00.0 chip-ID: 1002:67df class-ID: 0300 
           Display: x11 server: X.Org 1.20.14 compositor: xfwm4 v: 4.18.0 driver: 
           loaded: amdgpu,ati unloaded: fbdev,modesetting,vesa display-ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") 
           s-diag: 582mm (22.9") 
           Monitor-1: HDMI-A-0 res: 1920x1080 hz: 60 dpi: 102 size: 477x268mm (18.8x10.6") 
           diag: 547mm (21.5") 
           OpenGL: 
           renderer: AMD Radeon RX 570 Series (polaris10 LLVM 14.0.5 DRM 3.49 6.1.0-10mx-ahs-amd64) 
           v: 4.6 Mesa 22.0.5 direct render: Yes 
Audio:     Device-1: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] vendor: XFX Pine 
           driver: snd_hda_intel v: kernel bus-ID: 08:00.1 chip-ID: 1002:aaf0 class-ID: 0403 
           Device-2: AMD Family 17h HD Audio vendor: ASRock driver: snd_hda_intel v: kernel 
           bus-ID: 0a:00.3 chip-ID: 1022:1457 class-ID: 0403 
           Device-3: Texas Instruments PCM2902 Audio Codec type: USB 
           driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-8:3 chip-ID: 08bb:2902 
           class-ID: 0300 
           Sound Server-1: ALSA v: k6.1.0-10mx-ahs-amd64 running: yes 
           Sound Server-2: JACK v: 1.9.21 running: no 
           Sound Server-3: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASRock 
           driver: r8169 v: kernel port: f000 bus-ID: 07:00.0 chip-ID: 10ec:8168 class-ID: 0200 
           IF: eth0 state: up speed: 100 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 465.76 GiB used: 237.88 GiB (51.1%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital model: WDS500G2B0B-00YS70 
           size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD 
           serial: <filter> rev: 40WD scheme: MBR 
Partition: ID-1: / raw-size: 457.75 GiB size: 449.5 GiB (98.20%) used: 237.88 GiB (52.9%) fs: ext4 
           dev: /dev/sda1 maj-min: 8:1 
Swap:      Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 8 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/sda2 
           maj-min: 8:2 
Sensors:   Message: No sensor data found. Is lm-sensors configured? 
Repos:     Packages: 2994 note: see --pkg apt: 2982 lib: 1656 flatpak: 12 
           No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://deb.debian.org/debian bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://deb.debian.org/debian bullseye main contrib non-free
           2: deb http://security.debian.org/debian-security bullseye-security main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/google-earth-pro.list 
           1: deb [arch=amd64] http://dl.google.com/linux/earth/deb/ stable main
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://mxlinux.mirrors.uk2.net/packages/mx/repo/ bullseye main non-free
           2: deb http://mxlinux.mirrors.uk2.net/packages/mx/repo/ bullseye ahs
Info:      Processes: 366 Uptime: 37m wakeups: 8 Memory: 15.54 GiB used: 1.21 GiB (7.8%) 
           Init: SysVinit v: 2.96 runlevel: 5 default: 5 tool: systemctl Compilers: gcc: 10.2.1 
           alt: 10 Client: shell wrapper v: 5.1.4-release inxi: 3.3.06 
Boot Mode: BIOS (legacy, CSM, MBR)

Charlie Brown

Re: Suspend command keyboard shortcut

#2 Post by Charlie Brown »

Yes, that's the correct command, and it suspends without locking the screen.

You can also try:

Code: Select all

xfce4-session-logout --suspend
But, since normally pm-suspend works almost always:

Just install the 6.4 kernel with 2 clicks and try with that, cause that solved another suspend issue on mine, the problem may be due to 6.1

Also, to lock the screen at the same time: install suckless-tools and apply the command as:

Code: Select all

slock sudo pm-suspend
viewtopic.php?p=669514#p669514

viewtopic.php?p=705347#p705347


I,too do that on all machines. Simple, fast.

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

Re: Suspend command keyboard shortcut

#3 Post by PaulR »

Charlie Brown wrote: Mon Sep 04, 2023 5:35 am Yes, that's the correct command, and it suspends without locking the screen.
Yes, that's why I've always used it.

I'll give your suggestion re the kernel a try but it might take a while to see if that fixes the issue as it's an intermittent problem.

Thanks for the help!

Charlie Brown

Re: Suspend command keyboard shortcut

#4 Post by Charlie Brown »

Meanwhile, since you say it's "intermittent" and for it's a desktop it won't be difficult, also nothing to lose:

Take the rams out, then re-seat. This solved such freezings many times even when memtest showed everything was fine, especially those unknown/random ones ...

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

Re: Suspend command keyboard shortcut

#5 Post by PaulR »

Charlie Brown wrote: Mon Sep 04, 2023 10:40 am Meanwhile, since you say it's "intermittent" and for it's a desktop it won't be difficult, also nothing to lose:

Take the rams out, then re-seat. This solved such freezings many times even when memtest showed everything was fine, especially those unknown/random ones ...

I installed the 6.4 kernel and all worked well for the first four or five suspends but it just did the same thing again. I did notice that touching the power button brought up the log out dialog but the mouse and keyboard are inoperative so clearly the system is still working in some form, it's just the input that's being ignored.

I don't think badly seated RAM is the problem as my system is really stable otherwise, this suspend issue is the only thing that causes a freeze or necessitates a reboot. But thanks for the suggestion, I'll keep it in mind if nothing else works, meantime I'll try the alternative command!

Charlie Brown

Re: Suspend command keyboard shortcut

#6 Post by Charlie Brown »

MX-21 doesn't have it ootb, but in case you had manually installed xfce4-screensaver , just purge it (no matter it was disabled/enabled).

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

Re: Suspend command keyboard shortcut

#7 Post by PaulR »

Charlie Brown wrote: Tue Sep 05, 2023 7:16 am MX-21 doesn't have it ootb, but in case you had manually installed xfce4-screensaver , just purge it (no matter it was disabled/enabled).
No, I don't use screensavers. I've been using

Code: Select all

xfce4-session-logout --suspend
all day and it's worked without issue so far... fingers crossed!

Charlie Brown

Re: Suspend command keyboard shortcut

#8 Post by Charlie Brown »

... the weird thing is that this one also uses pm-suspend eventually, just a longer script: "if .. fi .. if .. fi, else ... blahblah .. pm-suspend .." :)

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

Re: Suspend command keyboard shortcut

#9 Post by PaulR »

Charlie Brown wrote: Tue Sep 05, 2023 3:40 pm ... the weird thing is that this one also uses pm-suspend eventually, just a longer script: "if .. fi .. if .. fi, else ... blahblah .. pm-suspend .." :)
Well I've no no issues in the last three days, during which the PC has probably been suspended 20 to 30 times so I'm marking the following command as the solution:

Code: Select all

xfce4-session-logout --suspend
Thanks Charlie Brown!

User avatar
Jerry3904
Administrator
Posts: 23615
Joined: Wed Jul 19, 2006 6:13 am

Re: Suspend command keyboard shortcut

#10 Post by Jerry3904 »

BTW: in MX-23 Fluxbox, the command is visible in Settings > Configure > Menus > Main

Code: Select all

sudo 'pm-suspend'
Production: MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: MX-25 Fluxbox, ThinkPad X1 Carbon gen 9 with i7
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

Post Reply

Return to “MX Help”