Power Saving for the Workstation, Part 2 - page 2
Automatically Suspending to RAM
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
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
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:
From within Xterm
# xset -dpms # xset +dpms # /usr/local/bin/sleep-detector-1.sh
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: GNOME 3.12 and New Betas for Ubuntu 14.04 and OpenMandriva Lx 2014.0
- 2Linux Top 3: Linus Lashes out, Linux 3.14 Gets PIE and Ubuntu One is Done.
- 3Linux Top 3: Ubuntu 14.04, Debian Gives Squeeze More Life and Red Hat Goes Atomic
- 4Linux Top 3: RHEL 6.5, Debian 7.2 and EOL for Linux 3.0.x
- 5Linux Top 3: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10