Sign up to Submit Content

Sign Up / Login
debiantutorials.org accepts no advertising. Quit asking me.
feed image
Guests 24
If you can walk and chew gum at the same time, you can run Linux

debian tutorials | debian support forum
I invite anyone familiar with Linux or Debian to register here at debiantutorials.org and write tutorials or related articles in order that everyone in the community can benefit. I'm talking to you. You say it better than I do. Your ideas just flow like water. There's so much more that needs to be written in ways that your cousin or an office manager can benefit from. Consider it.
debiantutorials.org is built on and runs on Debian.
Creative Commons License
Put Lenny to Sleep
Put your Debian Lenny laptop to Sleep PDF Print E-mail
Written by machiner   
Sunday, 19 October 2008 02:07

Put your Debian laptop to sleep; save power and time

Install origin: Lenny daily build, 16oct08, net install
Hardwarelshw > hardware.txt
Installeddpkg --get-selections > installed.txt

[EDIT These days, whether I install Gnome or not, I do install gnome-power-manager to handle putting my laptop to sleep. The program will live in your systray and you can set it up one time as you like and forget all about it. The following is still cool, though. I also forgot to mention that the following 2 packages must also be installed: radeontool vbetool.]

Short and sweet, this will take you mere moments to accomplish. The goal here is to have a handy shortcut icon for putting my laptop to sleep. I want it in the panel (taskbar, menubar, shortcut bar) on my custom Xfce4 Lenny desktop install and that's just what I've got. Click that little pic below, on the left, to see my panel.

The hibernate program is not needed for this and I don't have it installed. Instead I like to use s2ram wich comes with uswsusp, which is installed by default. I don't know how you guys do it, but on my Debian Lenny desktop this is how I get my laptop set up to be put to sleep.

The /usr/sbin/s2ram --force command must be run as root. So, I installed sudo for this purpose as I didn't want the overhead of gksu and I don't want my laptop awakening with a root terminal staring whomever lifted the lid in the face. Nuh, I'd rather not have that. So, sudo it is. Go ahead and install sudo:

# aptitude install sudo

Now, since I like using root regularly (when I need it) and don't really need sudo for other users, the only root ability that I will give myself through sudo is the ability to suspend the machine to ram. Precise control, that's what security is all about.

There are 2 things that I need to do to get my user account trusted with sudo capability.
  • add the user account to the sudo group: # adduser uname sudo
  • add the user account to the sudoers file: # visudo
You need to add the user account to this file as well as the permissions so you might add something like this:

uname ALL=/usr/sbin/s2ram --force

When you're finished, close the file the normal nano way; ctrl+x, y, enter.

Now, just logout one time to set your new group permission, log back in and make the shortcut on you taskbar. Right-click, add a thing. Just use sudo /usr/sbin/s2ram --force as the command and choose to run it in the terminal for your password prompt to work. That's it. Click it one time to test.

I don't run a standard Debian desktop with the typical Gnome environment so you may already have a handy shortcut for this. I run an Xfce4 desktop that I set up light with just what I use so I am used to making a few little shortcuts like this for myself. This whole proceedure takes less than a minute and it's only necessary the one time. Unless you reinstall.

--machiner 18oct08



Add this page to your favorite Social Bookmarking websites
Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! StumbleUpon! Yahoo! Free Joomla PHP extensions, software, information and tutorials.
Comments
Add New RSS
+/-
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly:
:dry::lol::kiss::D:pinch::(:shock:
:X:side::):P:unsure::woohoo::huh:
:whistle:;):s:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.
Samuel MacDowel  - hibernatio x sleep   |187.6.73.xxx |2009-02-28 02:07:50
Hello,

As far as I'm concerned uswsusp:
tools to use userspace software suspend provided by Linux
This
package (also known as µswsusp or simply suspend) contains the
programs to use the userspace software suspend
facility available in
Linux kernels 2.6.17-rc1 and higher. It allows the system to have its
state saved to
disk and be powered off. On restarting, it will be put
back in the state it was left in (this is sometimes
called
hibernation).

thanks
mac
Kishore Chalakkal  - Putting Lenny in hibernation   |87.7.179.xxx |2009-09-11 00:58:29
Just use the hibernation package.

The laptop gives me some errors so i use --force option.

Till now working
fine!

Kishore
Andrew  - Finally!   |69.159.76.xxx |2009-11-12 15:20:06
Thanks to this tutorial, I can at last put my T61 to sleep with the closed-source NVidia driver enabled. The
hibernate command would only work with the non-accelerated 'nv' driver.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated on Thursday, 26 March 2009 14:51