diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..e69de29 diff --git a/src/scripts/python/changemouse.py b/src/scripts/python/changemouse.py old mode 100755 new mode 100644 index ec4eedc..0df91d7 --- a/src/scripts/python/changemouse.py +++ b/src/scripts/python/changemouse.py @@ -8,8 +8,7 @@ are the rules: system + Touchpanel should be connected to the master "touch-pointer" -NOTE: master "touch-pointer" should be available on the event of adding the - mouse. This could be reached by adding this master to the system on boot. +NOTE: if master `touch` is not present in the system, Steps: + List all pointer as we don't know what pointer is added to the system @@ -36,5 +35,5 @@ if __name__ == "__main__": if not "eGalax" in pointer.name: com.reattach(pointer.id, core_master.id) else: - # TODO: add touchpannel support + pass diff --git a/src/scripts/python/setupmonitor.py b/src/scripts/python/setupmonitor.py new file mode 100644 index 0000000..ba3e849 --- /dev/null +++ b/src/scripts/python/setupmonitor.py @@ -0,0 +1,34 @@ + +"""Setup Monitor Script + +Author: Ali Hatami Tajik [hatam](mailto:a.hatam008@gmail.com) +Date: 2023 Mar 04 + + This script should be used whenever a change happen in the rdm system, I + guess! But as I investigate a rdm change event will happen many time in case + of addition or removal of a monitor auto configuration is done by the + org.mate.SettingsDaemon.plugins.xrandr deamon. I'll searching for a way to + change that event to run our specified script. + + + This script will do the following: + 1. List currently available monitors + 2. Map those to config file + 3. Replace default values for missing configs + 4. Handle missing touch-screen/main monitor + NOTE: In general we use at least two monitoers with our system. + One is for touch screen and one is for regular screen. In + case of one missing a callback is run to handle that + occurance (an event may send to the software or a temp log + file may be updated so the software adjust ifself + correspondigly). + + Config files are in JSON format and spesify screen output name and their + mode (xrandr resolution and stuff may be added but for now --auto/--prefered + option is used). The format is: + +""" + + +if __name__ == "__main__": + pass diff --git a/src/scripts/python/xutil/randr.py b/src/scripts/python/xutil/randr.py index b508a5b..5eebf9c 100644 --- a/src/scripts/python/xutil/randr.py +++ b/src/scripts/python/xutil/randr.py @@ -22,6 +22,7 @@ Utilities: from enum import Enum from dataclasses import dataclass +from typing import List # TODO: Option class which can be applied by get_args method @@ -65,9 +66,42 @@ class ReflectDir(Enum): @dataclass class Setting: + """Settings of a screen + + This data struct will be used as the config of each screen. Note that + default screen cannot be use + """ resolution = None, is_primary = False, is_enabeled = True, rotation = None position = None reflection = None + + +@dataclass +class Mode: + """Mode + + Mode of the screen including width, height, refresh rate(s) + """ + height: int = 0 + width: int = 0 + frequency: List[int] = [] + + +class Screen: + """Screen class + + This class will hold screen properties and methods related to the screens. + + At the time it will use xrandr (and not the verbose mode) to list the + screens and modes. + """ + + +class Monitor: + """Monitor Class + + List Monitor Outputs and their states + """ \ No newline at end of file