Screensaving when using xfce

The xfce desktop (in the Slackware 13 distribution) runs two different programs that attempt to do screen saving: xscreensaver and xfce-power-manager. xscreensaver seems to be primarily intended for displaying pretty patterns, although it can be configured to use DPMS (Display Power Management Signalling) to actually turn off the screen (and save power). xfce-power-manager can also be configured to use DPMS.

However, neither xscreensaver not xfce4-power-manager interacts well with MythTV's (or my) attempts to turn DPMS on/off when watching TV. They each believe that they are in sole control and will override any DPMS changes made elsewhere. I have not found any way of configuring them (or xfce) to behave more sensibly. It seems that the only way to get sensible screen-saving behaviour when using MythTV is to remove the xscreensaver and xfce4-power-manager packages.

The xscreensaver package is no great loss, since the X-server is perfectly capable of doing screen-saving itself (in the sense of using DPMS to turn off the screen to save power, not in the sense of displaying pretty patterns).

However, in the Slackware 13 distribution the xfce-power-manager package is also responsible for battery monitoring. If the xfce-power-manager package is removed, something else will have to monitor the battery. Fortunately, the xfce4-battery-plugin that we used under Slackware 11 can still be made to work under Slackware 13, so that can be used.

Configuring the X-server to use DPMS

DPMS defines four states for a display: on, standby, suspended, and off. The X-server allows you to configure timeouts for the standby, suspended and off states (called respectively StandbyTime, SuspendTime and OffTime), and will switch the display into the state if there has been no keyboard or mouse activity for the timeout period. Setting a timeout to 0 disables it.

For an LCD display, the standby, suspended and off states are actually equivalent. So the StandbyTime and SuspendTime can be set to 0 to disable them, and the OffTime can be used to the desired timeout period.

The X-server also has a timeout called BlankTime - this is the timeout for "blanking" the screen (i.e. displaying a "black" screen). Blanking leaves the LCD backlight on, and so is useless for power saving.


There are two ways of configuring the X-server to use DPMS for screen saving: in xorg.conf, or using the xset command.

Using xorg.conf to configure DPMS

If you are using a /etc/X11/xorg.conf file (or if you can be bothered to create one specially for the purpose), you can add the following lines to configure DPMS:
Options "DPMS" "true"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "5"

Note that timeout periods in xorg.conf are specified in minutes.

The X-server will need restarting for the changes to take effect.

Using the xset command to configure DPMS

It's also possible to change DPMS settings from the command line using the xset command (see its man page):

xset +dpms
Enables DPMS
xset -dpms
Disables DPMS
xset dpms force off
Turn off display immediately
xset dpms force on
Turn on display immediately
xset dpms 0 0 300
Set DPMS timeouts, in seconds. Numbers are for standby, suspend and off timeouts, in that order - so the above example sets the off timeout to 5 minutes, and disables the other two timeouts.

You can use the xset command in a ~/.xinitrc file to configure DPMS when the X-server starts. For example, the line:

xset +dpms dpms 0 0 300

will enable DPMS with a timeout of 5 minutes.

If you don't already have a ~/.xinitrc file, you can create one containing the following lines:

xset +dpms dpms 0 0 300
exec /usr/lib/X11/xinit/xinitrc

The second line is needed to get the default xinitrc file executed in addition to your own initialization.