Title photo
frugal technology, simple living and guerrilla large-appliance repair

Regular blog here, 'microblog' there

Many of my traditional blog post live on this site, but a great majority of my social-style posts can be found on my much-busier microbloging site at updates.passthejoe.net. It's busier because my BlogPoster "microblogging" script generates short, Twitter-style posts from the Linux or Windows (or anywhere you can run Ruby with too many Gems) command line, uploads them to the web server and send them out on my Twitter and Mastodon feeds.

I used to post to this blog via scripts and Unix/Linux utilities (curl and Unison) that helped me mirror the files locally and on the server. Since this site recently moved hosts, none of that is set up. I'm just using SFTP and SSH to write posts and manage the site.

Disqus comments are not live just yet because I'm not sure about what I'm going to do for the domain on this site. I'll probably restore the old domain at first just to have some continuity, but for now I like using the "free" domain from this site's new host, NearlyFreeSpeech.net.

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!