How to detect status of a PC monitor programmatically?

Dimitry Golubovsky golubovsky at
Wed Sep 7 12:23:41 PDT 2005

Is there any reliable way to detect the status
(connected/disconnected, connected power on, connected power off) of a
PC (suppose modern SVGA) monitor:

- via some I/O operation or ioctl request (Linux), or via an
X-protocol supported operation (if any)
- via (S)VGA board I/O registers/ports (perhaps will need a separate driver)

The idea is to force automatic screen/keyboard lockup (by running
xlock or a similar program) upon monitor being turned off/disconnected
from a PC that keeps running.

Dimitry Golubovsky

Anywhere on the Web

More information about the xorg mailing list