检测显示器是否关闭电源 [英] Detecting if the monitor is powered off

查看:216
本文介绍了检测显示器是否关闭电源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自助服务终端类型的应用程序,如果液晶电视已关闭电源,则需要通知我,以便我可以惩戒某人.我正在运行带有nVidia视频卡和nVidia驱动程序的Ubuntu 10.10.电视通过HDMI插入.

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.

我看过nvidia-settings -q ConnectedDisplaysnvidia-settings -q EnabledDisplays,但是两者都始终报告显示器已连接.我猜想该值仅在显示器首次开机时设置一次?

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?

我也查看了xrandr --properties,无论它总是报告default connected 1920x1080+0+0 0mm x 0mm.

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

我还能去哪里?

麦克斯,谢谢您为我指出正确的方向.至此,我已经安装了ddccontrol软件包,并且能够运行ddccontrol -p.如果显示器打开,我会收到很多电源,颜色和几何值,如果显示器关闭,则返回的大部分为空.我将研究一个小的python脚本来解析它.

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.

推荐答案

这是一个较旧的答案,可能会有所帮助:

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

这篇关于检测显示器是否关闭电源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆