Power Saving for the Workstation, Part 2
Automatically Suspending to RAM
In part 1, you were shown how to set up hibernate and modify the configuration scripts to make it possible to suspend your desktop to RAM. In part 2, you'll step through how to implement your changes.
In the KDE Control Center, drill down through Peripherals, Display, to the Power Saving tab. Check the Enable Power Saving checkbox and set time for "Switch Off Monitor." In a non-KDE environment, find "Display Power Management." That's what automatically turns off DPMS when the system is idling.
When your monitor is shut off via DPMS by whatever method, your computer will go into suspend if you install this script:
#!/bin/bash # put this in /usr/local/bin/sleep-detector-1.sh # put sh /usr/local/bin/sleep-detector.sh # default display on current host # moved xset +dpms to icon # try to make sure that monitor sessions don't multiply indefinitely # note: the echo statements are for debugging when running in a terminal. # the touch statements are also for debug. until [ "$STATUS" == "DPMS is Disabled" ]; do DISPLAY=:0.0 STATUS=`xset -display $DISPLAY -q | grep -o 'DPMS is Disabled'` if [ "$STATUS" == "DPMS is Disabled" ] then echo "end suspend monitor loop - DPMS Disabled" touch /home/username/suspend/dpms-disabled exit fi STATUS=`xset -display $DISPLAY -q | grep -o 'DPMS is Enabled'` if [ "$STATUS" == "DPMS is Enabled" ] then echo "SUSPEND script - DPMS working - continue monitoring" touch /home/username/suspend/dpms-enabled fi STATUS=`xset -display $DISPLAY -q | grep -o 'Monitor is On'` if [ "$STATUS" == "Monitor is On" ] then echo "Monitor is On - script" touch /home/username/suspend/monitor-is-on fi STATUS=`xset -display $DISPLAY -q | grep -o 'Monitor is Off'` if [ "$STATUS" == "Monitor is Off" ] then touch /home/username/suspend/monitor-is-off echo "Monitor is Off - script" hibernate-ram --force echo "hibernate-ram terminated" fi STATUS=`xset -display $DISPLAY -q | grep -o 'Monitor is in Suspend'` if [ "$STATUS" == "Monitor is in Suspend" ] then echo "Monitor is in Suspend - script" touch /home/username/suspend/monitor-is-suspend hibernate-ram --force fi STATUS=`xset -display $DISPLAY -q | grep -o 'Monitor is in Standby'` if [ "$STATUS" == "Monitor is in Standby" ] then echo "Monitor is in Standby-script" touch /home/username/suspend/monitor-is-standby hibernate-ram --force fi sleep 30 done exit
The touch statements are there for diagnostic purposes, they aren't necessary to the normal operation of the script, but the touch statements will tell you where the script crashed by simply checking to see what is in /home/username/suspend. Clear the directory before running the script if you're debugging.
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: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10
- 5Linux Top 3: Debian Dumps SPARC, Ubuntu Takes Over Linux 3.13 and the Core Infrastructure Initiative