Linux下获取屏幕供应商和序列号
我有一个 Gdk::Screen 实例,它代表连接到我的计算机的监视器。如何读取该显示器的供应商 ID 和/或序列号?
从 XScreen 获取供应商 ID 和序列号也足够了。
读取显示器的 EDID 也足够了。
有什么想法吗?谢谢!
I have an instance of Gdk::Screen
which represents a monitor connected to my computer. How can I read that monitor's vendor ID and/or serial number?
Getting the Vendor ID and Serial Number from an XScreen would also suffice.
Reading the EDID of the Monitor would also suffice.
Any ideas? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我还没有对此进行测试,但您应该能够查看 Gnome 的显示配置小程序的源代码。它在这里:
http://git。 gnome.org/browse/gnome-control-center/tree/panels/display/xrandr-capplet.c
函数
get_display_name()
看起来很有前途。看起来它使用了 libgnome-desktop 中的代码,也可以在同一个 git 浏览器中查看。I haven't tested this out, but you should be able to look at the source of Gnome's display configuration applet. It's here:
http://git.gnome.org/browse/gnome-control-center/tree/panels/display/xrandr-capplet.c
The function
get_display_name()
looks promising. It looks like it uses code from libgnome-desktop, which is also viewable in the same git browser.EDID 信息通常不完全由 X11 传递,而仅传递那些对图形重新生成重要的部分,即分辨率、物理尺寸等。可以为此实现 X11 扩展,但 ATM 没有这样的扩展。
所以你必须另外查询 EDID 信息。远程执行此操作是不可能的,但要读取本地计算机信息,可以使用诸如 read-edid 之类的工具。此外,可能还有图形驱动程序供应商特定的扩展来执行此操作,例如 NVidia 的 NV-CONTROL。
The EDID information usually is not passed on entirely by X11, but only those parts that matter for graphics renering, i.e. resolution, physical dimensions, stuff like that. It was possible to implement a X11 extension for this, but ATM there is no such one.
So you'll have to query the EDID information otherwise. Doing it remotely is impossible, but for reading local machine information there are tools like read-edid. Also there may be graphics driver vendor specific extensions, to do this, for example NV-CONTROL of NVidia.
在 gnome 系统上:
On a gnome system: