Difference between revisions of "Display Power Management Signaling"

From ArchWiki
Jump to: navigation, search
m (Prevent screen from turning off (in console))
m (updated wiki syntax, updated headlines)
Line 69: Line 69:
  
 
= DPMS Interaction in a console with setterm =
 
= DPMS Interaction in a console with setterm =
The setterm utility issues terminal recognized escape codes to alter the terminal. Essentially it just echos the terminal sequence to the current terminal device, whether that be in screen, a remote ssh terminal, console mode, serial consoles, etc.  
+
The ''setterm'' utility issues terminal recognized escape codes to alter the terminal. Essentially it just writes/echos the terminal sequences to the current terminal device, whether that be in screen, a remote ssh terminal, console mode, serial consoles, etc.  
 +
 
 +
{{Note|If you haven't already read the brief DPMS article linked to below, please skim it to understand how DPMS can be used in the console the same as in X.}}
  
 
== Prevent screen from turning off (in console) ==
 
== Prevent screen from turning off (in console) ==
Line 75: Line 77:
  
 
==Pipe the output to a cat to see the escapes ==
 
==Pipe the output to a cat to see the escapes ==
$ setterm -powerdown 2>&1 | exec cat -v 2>&1 | sed "s/\\^\\[/\\\\033/g"
+
{{cli|setterm -powerdown 2>&1 | exec cat -v 2>&1 | sed "s/\\^\\[/\\\\033/g"}}
  "\033[14;-3]"
+
  
 
==Pipe the escapes to any tty (with write/append perms) to modify that terminal==
 
==Pipe the escapes to any tty (with write/append perms) to modify that terminal==
Note the use of >> instead of >.  For permission issues using sudo in a script or something, you can use the tee program to append the output of setterm to the tty device, which tty's let appending sometimes but not writing.
+
Note the use of '''>>''' instead of '''>'''.  For permission issues using sudo in a script or something, you can use the '''tee''' program to append the output of setterm to the tty device, which tty's let appending sometimes but not writing.
$ setterm -powerdown 0 > /dev/tty3
+
{{cli|setterm -powerdown 0 > /dev/tty3}}
$ for TTYNUM in {0..256}; do setterm -powerdown 0 >> /dev/tty${TTYNUM}; done
+
 
 +
===Bash loop to set ttys 0-256===
 +
{{cli|for i in {0..256}; do setterm -powerdown 0 >> /dev/tty$i; done; unset i;}}
  
 
= External Resources =
 
= External Resources =
 
* [http://webpages.charter.net/dperr/dpms.htm PC Monitor DPMS specification explanation]
 
* [http://webpages.charter.net/dperr/dpms.htm PC Monitor DPMS specification explanation]

Revision as of 02:14, 6 August 2010

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 script: Template:File

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


DPMS Interaction in a console with setterm

The setterm utility issues terminal recognized escape codes to alter the terminal. Essentially it just writes/echos the terminal sequences to the current terminal device, whether that be in screen, a remote ssh terminal, console mode, serial consoles, etc.

Note: If you haven't already read the brief DPMS article linked to below, please skim it to understand how DPMS can be used in the console the same as in X.

Prevent screen from turning off (in console)

Template:Cli

Pipe the output to a cat to see the escapes

Template:Cli

Pipe the escapes to any tty (with write/append perms) to modify that terminal

Note the use of >> instead of >. For permission issues using sudo in a script or something, you can use the tee program to append the output of setterm to the tty device, which tty's let appending sometimes but not writing. Template:Cli

Bash loop to set ttys 0-256

Template:Cli

External Resources