从 Haskell 查找 X11 屏幕的数量
我想知道当前机器有多少个 X 屏幕,以使我的 .xmonad 更通用一些;我有一台上网本和一台带有两个显示器的台式机,我也使用几台单台受监控的机器。
为此,我希望能够找出当前机器有多少个X屏幕。 (我认为屏幕是正确的词,我指的是物理显示器)。
原因是我想要多个 xmobar 实例,每个显示器一个。我目前已将其硬编码为两个。
I'd like to know how many X screens the current machine has, to make my .xmonad a little more general; I have a netbook as well as a desktop with two monitors, and I use several single monitored machines too.
To this end, I'd like to be able to find out how many X screens the current machine has. (I think screens is the correct words, I mean physical monitors).
The reason being is that I want multiple instances of xmobar, one per monitor. I've hard coded it to be on two at the moment.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 X11 包:
它将动态返回一个
矩形
列表,告诉您有多少个屏幕及其尺寸。If you use the X11 package:
that will dynamically return a list of
Rectangle
s, telling you how many screens, and their dimensions.出于好奇,我最终使用了
我还发现 XMonad 模块有一个功能
For the curious, I ended up using
I also found out that the XMonad module has a function