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: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10
- 2Linux Top 3: Raspberry Pi B+, CentOS 7 and RHEL 5.11
- 3Linux Top 3: CoreOS Goes Stable, Oracle Clones RHEL 7 and Tails Updates
- 4Linux Top 3: Slackware Turns 21, Debian Squeezes and Linux 3.16 Nears
- 5Linux Top 3: Distrowatch, Deepin 2014 and the NSA