#!/usr/bin/perl -w use strict; # # This handy script watches when the screensaver activates and # toggles the lcd backlight. You won't see more than a # second of the screensaver, so you might as well chose one # which consumes few mips. # $ENV{'PATH'} = '/bin:/usr/bin'; delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; # $<=0; # become root not just effective root open(XS,"/usr/X11R6/bin/xscreensaver-command -watch|") or die; while() { if(/^BLANK/i) { system("echo off > /proc/omnibook/lcd"); } elsif(/^UNBLANK/i) { system("echo on > /proc/omnibook/lcd"); } }