diff --git a/src/scripts/python/setupmonitor.py b/src/scripts/python/setupmonitor.py index aa43d9e..3942701 100644 --- a/src/scripts/python/setupmonitor.py +++ b/src/scripts/python/setupmonitor.py @@ -28,6 +28,16 @@ Date: 2023 Mar 04 """ +import Xlib.display + +display = Xlib.display.Display() +root = display.screen().root +for m in root.xrandr_get_monitors(True).monitors: + connector = display.get_atom_name(m.name) + print( + f"{connector}, {m.width_in_pixels}x{m.height_in_pixels}, " + f"x={m.x}, y={m.y}" + ) if __name__ == "__main__": pass diff --git a/src/scripts/python/util/randr.py b/src/scripts/python/util/randr.py index 37fe1da..a278ce9 100644 --- a/src/scripts/python/util/randr.py +++ b/src/scripts/python/util/randr.py @@ -23,6 +23,8 @@ from enum import Enum from dataclasses import dataclass from typing import List +from Xlib.ext import randr as rnd + # TODO: Option class which can be applied by get_args method # TODO: Screen-related option class ~