Detecting if the monitor is powered off

旧城冷巷雨未停 提交于 2019-12-10 02:58:52

问题


I have a kiosk type application and I need to be notified if the LCD TV is powered off so I can chastise someone. I'm running Ubuntu 10.10 with nVidia video cards and the nVidia drivers. The TVs are plugged in via HDMI.

I've taken a look at nvidia-settings -q ConnectedDisplays and nvidia-settings -q EnabledDisplays, but both always report the monitor is connected. I'm guessing that this value is only set once when the monitor is first powered on?

I've also looked at xrandr --properties and it always reports default connected 1920x1080+0+0 0mm x 0mm regardless.

Where else can I look?

EDIT: Max, thanks for pointing me in the right direction. At this point I've installed the ddccontrol package and I'm able to run ddccontrol -p. If the monitor is turned on I receive a bunch of power, color and geometry values, and if the monitor is turned off it returns mostly empty. I'm going to work on a little python script to parse it out.


回答1:


Here is an older answer that might help: How to Determine if LCD Monitor is Turned on From Linux Command Line



来源:https://stackoverflow.com/questions/5813195/detecting-if-the-monitor-is-powered-off

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!