#!/bin/bash

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

cat > /etc/X11/xorg.conf.d/lt11.conf <<EOF
Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "NVTCapacitiveTouchScreen"
        Option  "Calibration"   "0 1200  0 2000"
        Option "TransformationMatrix"  "0 1 0 -1 0 1 0 0 1"
EndSection

Section "Monitor"
  Identifier "DSI1"
     Modeline "1200x2000_59.1"  153.60  1200 1228 1236 1267  2000 2026 2030 2052 -hsync -vsync
  Option "PreferredMode" "1200x2000_59.1"
  Option "Rotate" "right"
EndSection

Section "Screen"
  Identifier "Screen0"
  Monitor "DSI1"
  SubSection "Display"
    Modes "1200x2000_59.1"
  EndSubSection
EndSection
EOF
