From 94c9429abbc1d757aaf59e786d5aaa33fc9aabe6 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Tue, 10 Jan 2023 21:36:29 -0500 Subject: Add rotation script for the tablet --- bin/rot | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 bin/rot diff --git a/bin/rot b/bin/rot new file mode 100755 index 0000000..121471d --- /dev/null +++ b/bin/rot @@ -0,0 +1,48 @@ +#!/bin/sh +set -x + +IFS=" +" + +devices="$(xinput list --name-only | grep Wacom)" + +setTransform() { + for d in $devices ; do + xinput set-prop "$d" --type=float \ + "Coordinate Transformation Matrix" \ + "$@" + done +} + +while [ $# -gt 0 ] ; do case $1 in + left) + setTransform \ + 0 -1 1 1 0 0 0 0 1 + xrandr -o left + shift + ;; + right) + setTransform \ + 0 1 0 -1 0 1 0 0 1 + xrandr -o right + shift + ;; + normal) + setTransform \ + 0 0 0 0 0 0 0 0 0 + xrandr -o normal + shift + ;; + inverted) + setTransform \ + -1 0 1 0 -1 1 0 0 1 + xrandr -o inverted + shift + ;; + *) + echo Unknown option "$1"; + shift + exit 1 + ;; +esac ; done + -- cgit v1.2.3