#!/bin/bash
# Abort if Huion tablet is not connected/powered on.

if ! xrandr | grep -q '^HDMI-0 connected'; then
    echo "Huion display not connected. Aborting."
    exit 1
fi

xrandr --output HDMI-0 --mode 1920x1080 --right-of DP-0

/home/mick/bin/opentablet

id=$(xinput list --id-only "OpenTabletDriver Virtual Tablet")
echo "ID=$id"

xinput set-prop "$id" "Coordinate Transformation Matrix" \
1 0 0 0 1 0 0 0 1

#########################
##   contents of opentablet
#   #!/bin/bash
##   start OTD daemon in the background
#   otd-daemon &
##   launch the GUI
#  /usr/lib/opentabletdriver/OpenTabletDriver.UX.Gtk