Home | Hardware | Internet News |Web Hosting |IT Management |Network Storage
LinuxPlanet
Search 
  Power Search | Tips 

 Front Door
 Discussion
 LinuxEngine
 Opinions
 Reports
 Reviews
 Tutorials
 News
 Technology Jobs

 Browse by subject.
Free Newsletter

Java/Open Source Daily
Linux Today
More Free Newsletters

Be a Commerce Partner


















internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Print this article
Email this article

   LinuxPlanet / Tutorials







Power Saving for the Workstation, Part 2
Turning Suspend On, Off From the Desktop

A. Lizard
Tuesday, July 31, 2007 08:42:48 PM

Turning Suspend On, Off From the Desktop

What if you're doing a long download or any other lengthy unattended process which you do NOT want interrupted via suspend? Since the suspend sleep-detector.sh script for monitoring checks for DPMS being enabled, turning off DPMS will abort the script.

Figures 1 and 2 provide some icons for you to use. Right-click each of the icon images (48x48) and save them somewhere you can find them later.

For KDE users, right-click your desktop screen and Create New > Link to Application. On the General tab, click the icon displayed to open the Select Icon dialog box. Select the Other icons option and then Browse. Locate where you saved Figure 2 (suspend-off.png), and then click Open. Back in the General tab, enter Suspend Off in the Link to Application text box. In the Application tab, set the Command value to xset -dpms.

Repeat the process for the Suspend On icon, only this time enter this line in the Application tab's Command field:

xset +dpms;sh /usr/local/bin/sleep-detector-1.sh

Also in the Application tab, click the Advanced Features button and enter the User value as root.

To start suspend-to-RAM, click the Suspend On icon. This only works from root because the actual hibernate script does a "is the user root?" check, which I haven't figured out how to bypass, and the script doesn't run stably out of rc.local. You can run it manually from a script, if you do, you can tell if it's on by:

$ ps -A

Look for sleep, sh, you might see xset.

To shut it down, click the Suspend Off icon. Root access is not required, because while sleep-detector-1.sh runs as root, xset does not. If you want to revert to normal operation, you have to restart DPMS before restarting the script.

On my box and configuration, suspend takes about 30 seconds, returning from suspend takes about 20 seconds.

There was an intermittent problem with this, as the desktop didn't go into screensaver sometimes and then didn't go into suspend mode. It seems to have been fixed by removing the sh sleep-detector-1.sh command from rc.local, which is why the suspend monitor has to be started manually.

The workaround below may help you with problems that you might have that I didn't. Xterm is used here because the display might not be visible from the usual console window, and xterm works directly with X Windows.

Open an X Terminal via menu, with the Start > System > Xterm menu command. Or, from a regular terminal enter:

# xterm

From within Xterm

# xset -dpms
# xset +dpms
# /usr/local/bin/sleep-detector-1.sh

Next: Do You Have a UPS? »

Skip Ahead

1 Automatically Suspending to RAM
2 Turning Suspend On, Off From the Desktop
3 Do You Have a UPS?
4 Alternate Suspend Methods
5 Unsolved Problems
Figure 1: Suspend On Icon
Figure 1: Suspend On Icon

Figure 2: Suspend Off Icon
Figure 2: Suspend Off Icon





Linux is a trademark of Linus Torvalds.


internet.com home | search | help! | about us

Jupiter Online Media

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers