Setting HUION H610 Pro Pen Tablet to work with a dual monitor configuration

Hi.!

I have this pen tablet since some time ago and I have been using it with one monitor.
Recently I added a second monitor so I can work with one document in one monitor and other document in the other one. But The pen tablet was automatically set to span over both monitors, loosing resolution (indeed I was using only one half of the tablet), so I have been searching for configuration and I have made a script to set the tablet to span over both monitors, or just one of them. I post it here just in case it is useful for someone.


#!/bin/bash
#settings for HUION pen tablet

#from
#https://osu.ppy.sh/community/forums/topics/462916


#Default properties
#xinput list-props "HUION PenTablet Pen stylus"
#Device 'HUION PenTablet Pen stylus':
#        Device Enabled (143):   1
#        Coordinate Transformation Matrix (145): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
#        Device Accel Profile (275):     0
#        Device Accel Constant Deceleration (276):       1.000000
#        Device Accel Adaptive Deceleration (277):       1.000000
#        Device Accel Velocity Scaling (278):    10.000000
#        Device Node (267):      "/dev/input/event19"
#        Wacom Tablet Area (785):        0, 0, 40000, 25000
#        Wacom Rotation (786):   0
#        Wacom Pressurecurve (787):      0, 0, 100, 100
#        Wacom Serial IDs (495): 110, 1, 2, 0, 0
#        Wacom Serial ID binding (788):  0
#        Wacom Pressure Threshold (789): 27
#        Wacom Sample and Suppress (790):        2, 4
#        Wacom Enable Touch (791):       0
#        Wacom Hover Click (792):        1
#        Wacom Enable Touch Gesture (793):       0
#        Wacom Touch Gesture Parameters (794):   0, 0, 250
#        Wacom Tool Type (795):  "STYLUS" (405)
#        Wacom Button Actions (796):     "Wacom button action 0" (797), "Wacom button action 1" (798), "Wacom button action 2" (799)
#        Wacom button action 0 (797):    1572865
#        Wacom button action 1 (798):    1572866
#        Wacom button action 2 (799):    1572867
#        Wacom Pressure Recalibration (800):     1
#        Device Product ID (268):        9580, 110
#        Wacom Log Mask (801):   0
#        Wacom Debug Levels (802):       0, 0
#




#settings for two screens


case $1 in
  "full") 
    #using both screens, full screen
    xinput set-prop "HUION PenTablet Pen stylus" --type=float "Coordinate Transformation Matrix"  1 0 0 0 1 0 0 0 1 ;;
    
  "right")
    #right screen only, using full screen
    xinput set-prop "HUION PenTablet Pen stylus" --type=float "Coordinate Transformation Matrix"  0.5 0 0.5 0 1 0 0 0 1 ;;
    
  "left")
    #left screen only, using full screen
    xinput set-prop "HUION PenTablet Pen stylus" --type=float "Coordinate Transformation Matrix"  0.5 0 0 0 1 0 0 0 1  ;;
    
  *) echo "Format:  tablet-props.sh  full|left|right" ;;
esac




For now it is working fine for me although there are a lot more options I could include.

best regards