Title photo
frugal technology, simple living and guerrilla large-appliance repair
Wed, 16 Jan 2013

Is your screen blanking in Xfce despite your xscreensaver settings? I have the fix -- and this time it's for real

Some readers might have seen this post appear and disappear, appear and disappear again. That's because my first "fix" for this annonying Xfce problem didn't really work.

Neither did my second attempt. Nor my third.

Screw proverbs. The third fourth time now seems to be "the charm." That finally fortunate circumstance allows me to resurrect this entry yet again with my now-new onetwo-line script to keep the screen from blanking on its own -- without xscreensaver's help -- with a fix that has worked for me over the past couple of days. And this time I'm sure of it:

Here's a quick fix for Xfce users whose screens are blanking even though they have a much-longer screen-saving interval set in xscreensaver. This includes me.


A quick Google search turned up the following that told me to run one of the following two commands in a terminal. It also suggested dropping files into /etc/X11/xorg.conf.d, but I'm not there just yet.

I first got close with this line from an Xfce forum post:

$ xset dpms 0 0 600

I eventually switched all three DPMS parameters to 0. I really want xscreensaver to take over the standby, suspend and off states for the screen, not the default DPMS parameters as seen in xset.

I settled on this line, which worked great when run in a terminal after logging in with Xfce:

$ xset dpms 0 0 0

But turning that line into an executable script and then using Xfce's Session and Startup utility to run it on login didn't work. Something else was setting the DPMS parameters after my script ran on login.

I decided to use the sleep command to put a 200-second delay on the running of the rest of the script so I could start it on login but not have its effects reversed by whatever else is going on. I used chmod a+x with rootly privileges to make the script executable. I didn't have to put it in /usr/local/bin, as it will run from my /home directory, but I did put it there (again using rootly privileges) so any user on the system could find and run it.

Here is the script, which I called screen_blanking_off (but which you can call whatever you wish). Yes, there are a lot of inline notes. The script itself, not counting the shebang and exit lines and the notes is a mere two lines:

#! /bin/bash
#
# The purpose of this one-line script is to use the xset 
# utility to turn off screen blanking on my Debian Wheezy
# desktop under Xfce 4.8.
#
# This script is not needed in GNOME 3 but is helpful in Xfce
#
# The sleep command pauses the script for 200 seconds
# so it can be used in the Xfce Session and Startup utility
# without the xset parameters being reset by other login scripts
# that load afterward.
#
# Monitor DPMS power-saving features are set to 0 -- turned off --
# so xscreensaver can manage the display instead
#
sleep 200
xset dpms 0 0 0
exit 0

(Like the script's note say, I don't have this problem on this same system when running GNOME 3, just Xfce.)

After running the script either in a terminal or at startup, you can check your xset DPMS parameters in the terminal:

$ xset q

To understand what is going on, I referred to the man pages:

$ man sleep
$ man xset

As almost always, man pages on a Linux/Unix system shed considerable light on whatever you're trying to do with your computer: Read one (or more) today!