Skip to content

Instantly share code, notes, and snippets.

@nottux
Last active March 14, 2021 16:47
Show Gist options
  • Save nottux/cbd1d3e33e6c262ac09f542064713b11 to your computer and use it in GitHub Desktop.
Save nottux/cbd1d3e33e6c262ac09f542064713b11 to your computer and use it in GitHub Desktop.
Rotate drawing tablet 180 degrees on linux while using multiple or single monitor(s)
bash -c 'name="HUION Huion Tablet Pen (0)";a=($(xinput list-props "$name"| grep -Po "Coordinate\sTransformation\sMatrix(.*?):\s\K.*"|tr -d ","));a[2]=$(echo ${a[0]}+${a[2]}|bc);a[5]=$(echo ${a[4]}+${a[5]}|bc);a[0]=$(echo ${a[0]}*-1|bc);a[4]=$(echo ${a[4]}*-1|bc);xinput set-prop "$name" "Coordinate Transformation Matrix" ${a[*]}'
@nottux
Copy link
Author

nottux commented Feb 3, 2021

for script to work you need to install bc
remember to put your own device name instead HUION Huion Tablet Pen Pen (0) (you can get it by running xinput).
This is a one liner so you can put it as a keyboard shortcut from settings

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