Last active
February 11, 2017 18:20
-
-
Save prozacgod/64c43f399ac69310f06e8bd3c0b7d5b0 to your computer and use it in GitHub Desktop.
Script to switch a drawing tablet between left and right monitors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.