Browse Source

Adds snippet list monitors

pull/2/head
Ali Hatami Tajik 2 years ago
parent
commit
7dda5c15d1
  1. 10
      src/scripts/python/setupmonitor.py
  2. 2
      src/scripts/python/util/randr.py

10
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__": if __name__ == "__main__":
pass pass

2
src/scripts/python/util/randr.py

@ -23,6 +23,8 @@ from enum import Enum
from dataclasses import dataclass from dataclasses import dataclass
from typing import List from typing import List
from Xlib.ext import randr as rnd
# TODO: Option class which can be applied by get_args method # TODO: Option class which can be applied by get_args method
# TODO: Screen-related option class ~ # TODO: Screen-related option class ~

Loading…
Cancel
Save