Doesn't handle inactive monitors
shaicoleman opened this issue · comments
When there's an inactive monitor (e.g. laptop with a closed laptop lid), xrandr doesn't return a resolution, and thus fails to parse correctly:
Traceback (most recent call last):
File "./grout", line 211, in <module>
space = Space()
File "./grout", line 21, in __init__
self.identifyScreens()
File "./grout", line 40, in identifyScreens
newScreen = Screen(int(sizeAndPos[1]), int(sizeAndPos[2]), int(size[0]), int(size[1]), primary)
IndexError: list index out of range
Works when monitor is active, e.g.:
DisplayPort-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
Fails when monitor is inactive (no resolution returned), e.g.:
eDP connected (normal left inverted right x axis y axis)