diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2023-01-10 21:36:29 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2023-01-10 21:36:29 -0500 |
| commit | 94c9429abbc1d757aaf59e786d5aaa33fc9aabe6 (patch) | |
| tree | 1ecfdbe2a3ad7fe4c2bc6323a0b91f0e369ed175 | |
| parent | b893c2547d4ea73247f1ed5b1934187eb2c7d372 (diff) | |
| download | dotfiles-94c9429abbc1d757aaf59e786d5aaa33fc9aabe6.tar.gz dotfiles-94c9429abbc1d757aaf59e786d5aaa33fc9aabe6.tar.xz | |
Add rotation script for the tablet
| -rwxr-xr-x | bin/rot | 48 |
1 files changed, 48 insertions, 0 deletions
@@ -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 + |
