从Haskell找到X11屏幕的数量 [英] Finding the number of X11 screens from Haskell
问题描述
我想知道当前机器有多少X屏幕,使我的.xmonad更一般;我有一个上网本以及一个带有两个显示器的桌面,我也使用几个单独的被监控的机器。
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.
为此,我想了解当前机器有多少X屏幕。 (我认为屏幕是正确的话,我的意思是物理监视器)。
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).
原因是我想要xmobar的多个实例,每个显示器一个。
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.
推荐答案
如果您使用 X11软件包:
import Graphics.X11.Xinerama (getScreenInfo)
将会动态地返回 Rectangle
的列表,告诉你多少个屏幕及其尺寸。
that will dynamically return a list of Rectangle
s, telling you how many screens, and their dimensions.
这篇关于从Haskell找到X11屏幕的数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!