aboutsummaryrefslogtreecommitdiff
path: root/x/rot
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2024-01-20 12:31:58 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2024-01-20 12:31:58 -0500
commite2a0cf2a79b43f9f86b74270f3d96fe300687804 (patch)
treea87edf55f81e78f4d0968d6f006562090260e068 /x/rot
parentec83443853116b07f18fbef8c6de31cf157939a0 (diff)
downloaddotfiles-e2a0cf2a79b43f9f86b74270f3d96fe300687804.tar.gz
dotfiles-e2a0cf2a79b43f9f86b74270f3d96fe300687804.tar.xz
Cleanup unused files and code.
Diffstat (limited to 'x/rot')
-rwxr-xr-xx/rot48
1 files changed, 48 insertions, 0 deletions
diff --git a/x/rot b/x/rot
new file mode 100755
index 0000000..121471d
--- /dev/null
+++ b/x/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
+