def _apply(self, force=False):
        """
        Call xrandr and apply the selected (displayed) combination mode.
        """
        if self.displayed == self.active_layout and not force:
            # no change, do nothing
            return

        combination, mode = self.combinations_map.get(self.displayed, (None, None))
        if combination is None and mode is None:
            # displayed combination cannot be activated, ignore
            return

        cmd = "xrandr"
        outputs = list(self.layout["connected"])
        outputs += list(self.layout["disconnected"])
        previous_output = None
        primary_added = False
        for output in outputs:
            cmd += f" --output {output}"
            #
            if output in combination:
                pos = getattr(self, f"{output}_pos", "0x0")
                primary = getattr(self, f"{output}_primary", None)
                resolution = getattr(self, f"{output}_mode", None)
                resolution = f"--mode {resolution}" if resolution else "--auto"
                rotation = getattr(self, f"{output}_rotate", "normal")
                if rotation not in ["inverted", "left", "normal", "right"]:
                    self.py3.log(f"configured rotation {rotation} is not valid")
                    rotation = "normal"
                #
                if primary is True and not primary_added:
                    primary_added = True
                    cmd += " --primary"
                if mode == "clone" and previous_output is not None:
                    cmd += f" {resolution} --same-as {previous_output}"
                else:
                    if "above" in pos or "below" in pos or "left-of" in pos or "right-of" in pos:
                        cmd += f" {resolution} --{pos} --rotate {rotation}"
                    else:
                        cmd += " {} --pos {} --rotate {}".format(resolution, pos, rotation)
                previous_output = output
            else:
                cmd += " --off"
        #
        code = self.py3.command_run(cmd)
        if code == 0:
            self.active_comb = combination
            self.active_layout = self.displayed
            self.active_mode = mode
        self.py3.log(f'command "{cmd}" exit code {code}')

        if self.command:
            self.py3.command_run(self.command)

        # move workspaces to outputs as configured
        self._apply_workspaces(combination, mode)

        Call xrandr and apply the selected (displayed) combination mode.
        
py3status/modules/xrandr.py