My *nix world

Suspend laptop Linux with 1 line of code

I have Gentoo with Xfce desktop environment. It has a xfce4-session-logout command which displays a logout-suspend-shutdown confirmation screen where you can choose what you want to do.

Sometimes I only need to suspend to RAM the session and I want to do it quick, from keyboard, not using the mouse in two-three steps.

Suspend laptop Linux

For those which feel the same I have a tip to share:

echo -n mem > /sys/power/state

I defined a keyboard shortcut that call that line of code, so that way I became able to suspend my laptop from keyboard, with just 1 line of code.

Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.

The following two tabs change content below.
Suspend laptop Linux with 1 line of code

Eugen Mihailescu

Founder/programmer/one-man-show at Cubique Software
Always looking to learn more about *nix world, about the fundamental concepts of math, physics, electronics. I am also passionate about programming, database and systems administration. 16+ yrs experience in software development, designing enterprise systems, IT support and troubleshooting.
Suspend laptop Linux with 1 line of code

Latest posts by Eugen Mihailescu (see all)

Tagged on: ,

Leave a Reply

Your email address will not be published. Required fields are marked *