X-Git-Url: https://git.ralfj.de/lilass.git/blobdiff_plain/fcdeaedef970f8cd47f66f97d755756a0fe0e40a..HEAD:/lilass?ds=sidebyside diff --git a/lilass b/lilass index 2352e32..3512a5f 100755 --- a/lilass +++ b/lilass @@ -22,14 +22,6 @@ import gui, screen, util, database frontend = gui.getFrontend("cli") # the fallback, until we got a proper frontend. This is guaranteed to be available. cmdArgs = None -# for auto-config: common names of internal connectors -commonInternalConnectorPrefixes = ['LVDS', 'eDP'] -commonInternalConnectorSuffices = ['', '0', '1', '-0', '-1'] -def commonInternalConnectorNames(): - for prefix in commonInternalConnectorPrefixes: - for suffix in commonInternalConnectorSuffices: - yield prefix+suffix - # Load a section-less config file: maps parameter names to space-separated lists of strings (with shell quotation) def loadConfigFile(filename): import shlex @@ -74,23 +66,10 @@ def situationByConfig(config): raise Exception("You must specify exactly one internal connector.") internalConnectors = config['internalConnector'] else: - internalConnectors = commonInternalConnectorNames() + internalConnectors = screen.commonInternalConnectorNames() # run! return screen.ScreenSituation(internalConnectors, config.get('externalConnectors')) -class ShowLevels(Enum): - ONEXTERNAL = ("on-external") - ONNEW = ("on-new") - ONERROR = ("on-error") - def __init__(self, text): - # auto numbering - cls = self.__class__ - self._value_ = len(cls.__members__) + 1 - self.text = text - @classmethod - def getNames(cls): - return list(x.text for x in cls) - # if we run top-level if __name__ == "__main__": try: @@ -173,9 +152,9 @@ if __name__ == "__main__": setup = screen.ScreenSetup(intResolution = None, extResolution = situation.externalConnector.getPreferredResolution()) elif cmdArgs.rel_position is not None: # construct automatically, based on CLI arguments - # first, figure out the desired RelativeScreenPosition... waht a bad hack... + # first, figure out the desired RelativeScreenPosition... what a bad hack... relPos = list(filter(lambda relPosItem: relPosFilter(relPosItem[0]) == cmdArgs.rel_position, screen.RelativeScreenPosition.__members__.items())) - assert len(relPos) == 1, "CLI argument is ambigue" + assert len(relPos) == 1, "CLI argument is ambiguous" relPos = relPos[0][1] # now we construct the ScreenSetup if relPos == screen.RelativeScreenPosition.MIRROR: