@property
def option_vector(self):
"Return the command line parameters for XRandR for this instance"
- return sum([["--%s" % option[0], option[1]] if option[1] else ["--%s" % option[0]] for option in chain((("output", self.output),), self.options_with_defaults.items())], [])
+ return sum([["--%s" % option[0], option[1]] if option[1] else ["--%s" % option[0]] for option in chain((("output", self.output),), sorted(self.options_with_defaults.items()))], [])
@property
def option_string(self):
"Return the command line parameters in the configuration file format"
- return "\n".join([ " ".join(option) if option[1] else option[0] for option in chain((("output", self.output),), self.options.items())])
+ return "\n".join([ " ".join(option) if option[1] else option[0] for option in chain((("output", self.output),), sorted(self.options.items()))])
@property
def sort_key(self):
# Split at output boundaries and instanciate an XrandrOutput per output
split_xrandr_output = re.split("(?m)^([^ ]+ (?:(?:dis)?connected|unknown connection).*)$", xrandr_output)
+ if len(split_xrandr_output) < 2:
+ raise RuntimeError("No output boundaries found")
outputs = OrderedDict()
modes = OrderedDict()
for i in range(1, len(split_xrandr_output), 2):
disable_argv = []
# Enable remaining outputs in pairs of two
+ # This is required because some drivers can't handle enabling many outputs
+ # in one call. See
+ # https://github.com/phillipberndt/autorandr/pull/6
+ # and commits f4cce4d and 8429886.
remaining_outputs = [ x for x in outputs if configuration[x].edid ]
for index in range(0, len(remaining_outputs), 2):
argv = base_argv[:]