Subject: Re: determining if the screen is blanked
To: None <netbsd-users@netbsd.org>
From: Aaron J. Grier <agrier@poofygoof.com>
List: netbsd-users
Date: 07/29/2005 10:29:05
On Thu, Jul 28, 2005 at 01:00:31PM -0400, Steven M. Bellovin wrote:
> I'd like to find a way to tell, from a shell script, if the (X
> windows) screen is blanked on my machine.  In particular, I'd like to
> avoid displaying new background images on my laptop if the screen is
> blanked (and if the machine is on battery, but I know how to test
> that).  
> 
> If it matters, I'm running Xorg.

xset q

has a section:

DPMS (Energy Star):
  Standby: 1200    Suspend: 1800    Off: 2400
  DPMS is Enabled
  Monitor is On

a little greppery should get you what you need.

-- 
  Aaron J. Grier | "Not your ordinary poofy goof." | agrier@poofygoof.com