Suspend your laptop with 1 line of code

Please note that this blog has been moved.

Now it has its own domain: 🙂

If you want to read the latest version of this article (recommended) please click here and I open the page for you.

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.

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.


About Eugen Mihailescu

Always looking to learn more about *nix world, about the fundamental concepts of arithmetic, algebra and geometry. I am also passionate about programming, database and systems administration.
This entry was posted in linux, shell, xfce and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s