#!/bin/bash

echo "ENV{IIO_SENSOR_PROXY_TYPE}==\"*accel*\", ENV{ACCEL_MOUNT_MATRIX}=\"0,1,0;1,0,0;0,0,1\"" > /etc/udev/rules.d/99-astra-mobile-orientation.rules

echo 'Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "GXTP7386:00 27C6:011A"
        Option "TransformationMatrix"  "0 1 0 -1 0 1 0 0 1"
EndSection

Section "Monitor"
    Identifier "DSI1"
        Modeline "1200x1920_58.5"  158.40  1200 1280 1304 1384  1920 1936 1940 1956 -hsync -vsync
    Option "PreferredMode" "1200x1920_58.5"
    Option "Rotate" "right"
EndSection

Section "Screen"
    Identifier "Screen0"
    Monitor "DSI1"
    DefaultDepth 24
    SubSection "Display"
        Modes "1200x1920_58.5"
    EndSubSection
EndSection

' > /etc/X11/xorg.conf.d/99-calibration.conf
