When I click on the exit icon there is a suspend option. When I click this the computer suspends, which works really well. I want to create a custom key mapping on the suspend command XK86Sleep (ThinkPad sleep button) which I can create using the keyboard settings.

I have seen pm-suspend from numerous sources, but this requires root and so does not work. What command does XFCE use when pressing the Suspend option through the UI as described above?

XFCE 4.8, Ubuntu 12.04, ThinkPad T60


Try using this for the command

xfce4-session-logout -s

man xfce4-session-logout

The xfce4-session-logout command allows you to programmatically logout from your Xfce session. It requests the session manager to display the logout confirmation screen, or, if given one of the command-line options below, causes the session manager to take the requested action immediately.

--suspend Suspend without displaying the logout dialog

| improve this answer | |
systemctl suspend

Also works for me. As a bonus it works across xfce4 and cinnamon desktops.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.