How do you tell if a computer's monitor(s) are turned on/off from the command line in Linux? I've traditionally thought of monitors as output-only devices, but I've noticed the Gnome Monitor Preferences dialog has a "detect monitor" function. Can this be generalized to determine if a monitor is physically turned off?
相关问题
- How to get the return code of a shell script in lu
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Invoking Mirth Connect CLI with Powershell script
- Error building gcc 4.8.3 from source: libstdc++.so
The VESA DDC connection is an I2C connection that can be used to query the presence of the monitor.
Linux exposes the I2C device and userland programs can communicate directly with the monitor with code such as that at http://jaffar.cs.msu.su/oleg/ddcci/
Notice this below:
Control 0xe1: +/1/1 [SAM: Power control (0 - off/1 - on)]
An interesting question is whether or not your monitor returns that piece of data, and if not, whether it responds at all if it's currently turned off.