From: Tim Ruffing Date: Sat, 6 Oct 2012 10:28:35 +0000 (+0200) Subject: ignore "Screen" lines in xrandr -q and accept connector identifiers that contain... X-Git-Url: https://git.ralfj.de/lilass.git/commitdiff_plain/5692eb143df0b812e918e4d4802626cf5f99029d?ds=sidebyside;hp=--cc ignore "Screen" lines in xrandr -q and accept connector identifiers that contain a hyphen (e.g. HDMI-0) --- 5692eb143df0b812e918e4d4802626cf5f99029d diff --git a/dsl.py b/dsl.py index 75f1cf2..d46f620 100755 --- a/dsl.py +++ b/dsl.py @@ -22,7 +22,7 @@ from selector_window import PositionSelection app = QtGui.QApplication(sys.argv) # for auto-config: common names of internal connectors -commonInternalConnectorNames = ['LVDS', 'LVDS1'] +commonInternalConnectorNames = ['LVDS', 'LVDS1', 'LVDS-0'] # Load a section-less config file: maps parameter names to space-separated lists of strings (with shell quotation) def loadConfigFile(file): @@ -52,8 +52,11 @@ def getXrandrInformation(): connectors = {} # map of connector names to a list of resolutions connector = None # current connector for line in p.stdout: + # ignore screens + if line.startswith("Screen"): + continue # new connector? - m = re.search(r'^([\w]+) (dis)?connected ', line) + m = re.search(r'^([\w\-]+) (dis)?connected ', line) if m is not None: connector = m.groups()[0] assert connector not in connectors