Linux下获取屏幕供应商和序列号

发布于 2024-11-28 02:36:14 字数 148 浏览 1 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

﹏雨一样淡蓝的深情 2024-12-05 02:36:14

我还没有对此进行测试,但您应该能够查看 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.

玩心态 2024-12-05 02:36:14

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.

以酷 2024-12-05 02:36:14

在 gnome 系统上:

$ grep -E 'product|serial' ~/.config/monitors.xml

On a gnome system:

$ grep -E 'product|serial' ~/.config/monitors.xml
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文