I'm trying to setup a short key to suspend. When using command systemctl suspend
, it works, but after wakeup I could not press any key until a mouse click then the keyboard works again. This does not happen when doing suspend by click on Power icon. I wonder if anyone know what command is executed when we click on Power icon to do suspend? It's minor issue but still annoying for me. Thanks
Suspend from terminal
minh https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate
for info but small tab at top-center called 'discussion' has a discussion of user-tried commands and workaround for what you are trying to do. I don't have a laptop so can't speak to terminal command effectiveness, via systemctl etc, for suspend in an arch article but interesting. all variations of what you are trying to do. I saw no single magic key command but you might be led in that direction.
- Edited
brent Thanks for looking into it. I have followed the article but have had no luck so far.
I found this command work from terminal
dbus-send --system --print-reply --dest="org.freedesktop.login1" /org/freedesktop/login1 org.freedesktop.login1.Manager.Suspend boolean:true
But setting up a system shortcut using this command has the same issue. I think some magic that Power Dialog works differently compared to the setup from system shortcut. At least I found this shortkey <Super>+<Shift>+P to bring up Power Dialog. I will live with it for now.