Hi there.  Just subscribed to this list, and thought I'd share a solution
to a problem before I start asking about the problems I haven't solved
yet.  And also I'm curious if anyone has a better way to do this.

I'm running woody on a Pismo PowerBook G3, with Ben's rsync kernel...  I
wanted to have it dim the screen after some idle time, and then turn it
back on when i touch the mouse/keyboard, which is a feature that MacOS
has.  I knew about fblevel for actually turning the screen off and on
manually, but needed something to handle the idle timeout...  So I looked
at xscreensaver and figured out the following...  (jwz's man page is
really informative!)

The script below works as a "graphics hack" for xscreensaver (though in
fact of course it doesn't do any graphics at all).  It dims the screen
when xscreensaver becomes active, and then turns the screen back on when
xscreensaver kills it.  Just create the following script, and configure
xscreensaver to only use this (instead of the big list of graphical things
it can do).

---
#!/bin/sh

# the "wakeup" code
trap "sudo /sbin/fblevel 15; sudo /sbin/hdparm -S 60 /dev/hda; exit" 15

# the "go to sleep" code
sudo /sbin/fblevel 0
sudo /sbin/hdparm -S 12 /dev/hda

# and the "continue to sleep" code
while [ 1 ]; do sleep .5; done
---

Note that this is not actually putting the machine to sleep, it's just
turning off the screen.  And it also sets the hard drive spin down timeout
to 1 minute...  In order for this to work I had to set up sudo to allow my
user to run fblevel and hdparm as root, with no password.  (See the sudo
man page...)

As I said, I'm curious if there was an easier way to do this...  Also, I
haven't figured out a way to make xscreensaver use different configs on
different hosts, which would be handy since my home directory is
NFS-mounted.

Have fun!

...derFlieN

NeilFred Picciotto
fred (at) derf (dot) net

Reply via email to