Skip to content

Instantly share code, notes, and snippets.

@prozacgod
Last active February 11, 2017 18:20
Show Gist options
  • Save prozacgod/64c43f399ac69310f06e8bd3c0b7d5b0 to your computer and use it in GitHub Desktop.
Save prozacgod/64c43f399ac69310f06e8bd3c0b7d5b0 to your computer and use it in GitHub Desktop.
Script to switch a drawing tablet between left and right monitors
#!/bin/bash
right="0.5 0 0.5 0 1 0 0 0 1"
left="0.5 0 0 0 1 0 0 0 1"
id=`xinput | grep "PenTablet Pen" | cut -d= -f2 | cut -d\[ -f1`
side="$1"
matrix=""
case $side in
left)
matrix="$left"
;;
right)
matrix="$right"
;;
esac
if [ -z "$matrix" ]; then
echo "Must specify left or right monitor"
fi
xinput set-prop 11 --type=float "Coordinate Transformation Matrix" $matrix
@prozacgod
Copy link
Author

I wrote this to switch my Huion tablet under linux from left to right screens using xinput transformation matrix (scaling the tablet to on screen) instead of the tablet's active area spanning both screens.

May or may not work for you out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment