Difference between revisions of "Display Power Management Signaling"

From ArchWiki
Jump to: navigation, search
(Setting up DPMS in X)
(Cleaned up display.sh)
Line 37: Line 37:
 
  #
 
  #
 
   
 
   
XSET=/usr/bin/xset
+
  if [ [ $1 = "standby" ] ] || [ [ $1 = "suspend" ] ] || [ [ $1 = "off" ] ]; then
+
xset dpms force $1
  if [ $1 ]; then
+
        if [ $1 = "standby" ] || [ $1 = "suspend" ] || [ $1 = "off" ]; then
+
                $XSET dpms force $1
+
        else
+
                echo "Usage: $0 standby|suspend|off"
+
                exit
+
        fi
+
 
  else
 
  else
        echo "$0 usage: $0 standby|suspend|off"
+
echo "Usage: $0 standby|suspend|off"
        exit
+
exit 1
 
  fi
 
  fi
Make it executable (<tt>chmod +x /usr/local/bin/display.sh</tt>) and just run <tt>display.sh off</tt>. For the latter to work you need to include /usr/local/bin into your path, otherwise you have to execute it with the whole path:
+
 
 +
Make it executable (<tt>chmod u+x /usr/local/bin/display.sh</tt>) and just run <tt>display.sh off</tt>. For the latter to work you need to include /usr/local/bin into your path, otherwise you have to execute it with the whole path:
 
  # With /usr/local/bin in your PATH
 
  # With /usr/local/bin in your PATH
 
  display.sh suspend
 
  display.sh suspend
Line 56: Line 50:
 
  # Without /usr/local/bin in your PATH
 
  # Without /usr/local/bin in your PATH
 
  /usr/local/bin/display.sh standby
 
  /usr/local/bin/display.sh standby
This small script can probably be made much more elegant (feel free to fix it), but it works just fine for me.
 
  
 
== Disable DPMS and prevent screen from turning off (thanks damir) ==
 
== Disable DPMS and prevent screen from turning off (thanks damir) ==

Revision as of 06:45, 16 December 2009

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n links end

DPMS (Display Power Management Signaling) is a technology that allows power saving behaviour of monitors when the computer is not in use.

Setting up DPMS in X

Add the following to your /etc/X11/xorg.conf in the Monitor section:

Option "DPMS" "true"

Add the following to the ServerLayout section, change the times (in minutes) as necessary:

Option "StandbyTime" "10"
Option "SuspendTime" "20"
Option "OffTime" "30"

Note: If the "OffTime" option does not work replace it with the following, (change the "blanktime" to "0" to disable screen blanking)

Option         "BlankTime" "30"

DPMS Interaction using xset

It is possible to turn off your monitor using the xset tool.

xset dpms force standby

puts the screen(s) into standby,

xset dpms force suspend

makes them to suspend and

xset dpms force off

turns them off immediately. If you leave your computer, you don't need to wait for the timeout you set that the display turns off. Simply enfoce it by using the xset command.

Note that you may need to prefix the command with sleep 1; for it to work correctly. For example,

sleep 1; xset dpms force off

You could also copy this code into /usr/local/bin/display.sh:

#!/bin/bash
#
# Small script to set display into standby, suspend or off mode
# 20060301-Joffer
#

if [ [ $1 = "standby" ] ] || [ [ $1 = "suspend" ] ] || [ [ $1 = "off" ] ]; then
	xset dpms force $1
else
	echo "Usage: $0 standby|suspend|off"
	exit 1
fi

Make it executable (chmod u+x /usr/local/bin/display.sh) and just run display.sh off. For the latter to work you need to include /usr/local/bin into your path, otherwise you have to execute it with the whole path:

# With /usr/local/bin in your PATH
display.sh suspend

# Without /usr/local/bin in your PATH
/usr/local/bin/display.sh standby

Disable DPMS and prevent screen from turning off (thanks damir)

Useful when watching movies or slideshows:

The first command turns off DPMS

xset -dpms

This one disables screen saver blanking:

xset s off

External Resources