def METHOD_NAME(cls):
    # pylint: disable=R0912,R0914,R0915
    # Suppress warnings about too many local variables.
    # Get updated monitor information from xrandr.
    try:
        p = Popen(["xrandr"], stdout=PIPE)
        stdout, _ = p.communicate()
        # Decode output if it is binary.
        encoding = locale.getpreferredencoding()
        if isinstance(stdout, binary_type):
            stdout = stdout.decode(encoding)
        # Handle non-zero return codes.
        if p.wait() > 0:
            print(stdout)
            raise RuntimeError("xrandr exited with non-zero return "
                               "code %d" % p.returncode)
    except Exception as e:
        cls._log.error("Failed to execute command: %s. Is "
                       "xrandr installed?", e)
        raise e
    # Parse output from xrandr.
    monitors = []
    for line in stdout.split("\n")[1:]:  # skip the first line
        # Skip disconnected monitors, output modes and empty lines.
        if not line or "disconnected" in line or line.startswith("   "):
            continue
        # Get the information we need.
        parts = line.split()
        name = parts.pop(0)
        primary = "primary" in parts
        if primary:  # this monitor will be first in the list
            parts.remove("primary")
        # Find and remove info we don't need (e.g. 'connected' and
        # orientation info).
        i = 1
        for i, part in enumerate(parts):
            if "(" in part:  # e.g. '(normal'
                break
        parts = parts[1:i]
        # Skip disabled monitors (no reported mode info).
        if not parts:
            continue
        # Get resolution and position info.
        res_info = parts[0].split("+")
        dx, dy = res_info.pop(0).split("x")
        top_left_x, top_left_y = res_info
        # Convert values to integers and create a rectangle object
        # representing the monitor's dimensions and relative position.
        dx, dy = int(dx), int(dy)
        top_left_x, top_left_y = int(top_left_x), int(top_left_y)
        rectangle = Rectangle(top_left_x, top_left_y, dx, dy)
        # Get a new or updated monitor object and add it to the list.
        monitor = cls.get_monitor(name, rectangle)
        monitor.is_primary = primary
        # Ensure that the top_left monitor is the first in the list.
        if top_left_x == 0:
            monitors.insert(0, monitor)
        else:
            monitors.append(monitor)
    # Return the list of monitors.
    return monitors