项目作者: eklitzke

项目描述 :
Grab Wayland info
高级语言: C
项目地址: git://github.com/eklitzke/wlinfo.git
创建时间: 2017-10-28T03:19:49Z
项目社区:https://github.com/eklitzke/wlinfo

开源协议:Other

下载


Wlinfo queries Wayland for information about physical displays connected to the
system. It can print information about the physical dimensions of such displays,
and screen resolution, and display scaling characteristics.

Wlinfo is built as a standard automake/autoconf program:

  1. $ ./autogen.sh
  2. $ ./configure
  3. $ make

The output of wlinfo looks like this:

  1. output 4
  2. ---------
  3. x: 0
  4. y: 0
  5. physical_width: 640
  6. physical_height: 400
  7. subpixel: 0
  8. make: DEL
  9. model: DELL U3014
  10. width: 2560
  11. height: 1600
  12. dpi: 103.2
  13. scale: 1
  14. output 5
  15. ---------
  16. x: 2560
  17. y: 0
  18. physical_width: 310
  19. physical_height: 170
  20. subpixel: 0
  21. make: MEI
  22. model: 0x96a2
  23. width: 2560
  24. height: 1440
  25. dpi: 451.3
  26. scale: 2

My personal motivation for this code is to allow Emacs instances to pick an
appropriate font size. This is necessary because I have a high-DPI laptop
screen, and a low-DPI monitor that I sometimes attach to my laptop. Wayland
itself supports per-monitor display scaling, so it can scale the high-DPI
monitor at 2x (for instance), and the low-DPI monitor at 1x. However, Emacs is a
legacy X11 application that can’t do display scaling. Therefore I need my Emacs
instance to choose an appropriate font size based on which physical displays are
actually connected to the system at the time that Emacs starts up.

This code is released under a version of the MIT license used by X11. This is
the same license used by Wayland and Weston. Some of this code is derived from
code found in Weston (in particular, the code for weston-info).