From 28e8bdf7f8286bd431b7f3b709e79f3827b31469 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Wed, 24 Dec 2025 13:54:03 +0900 Subject: updates --- debian/.local/bin/tablet | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 debian/.local/bin/tablet (limited to 'debian/.local/bin/tablet') diff --git a/debian/.local/bin/tablet b/debian/.local/bin/tablet new file mode 100755 index 0000000..1b4e556 --- /dev/null +++ b/debian/.local/bin/tablet @@ -0,0 +1,39 @@ +#!/bin/sh + +# Find the line in "xrandr -q --verbose" output that contains current screen orientation and "strip" out current orientation. +rotation="$(xrandr -q --verbose | grep 'connected' | grep -Eo '\) (normal|left|inverted|right) \(' | grep -Eo '(normal|left|inverted|right)')" +penstylus="$(xsetwacom list devices | grep 'Pen' | grep 'stylus' | sed 's/\s*id.*//g')" +penerase="$(xsetwacom list devices | grep 'Pen' | grep 'erase' | sed 's/\s*id.*//g')" +fingertouch="$(xsetwacom list devices | grep 'Finger' | grep 'touch' | sed 's/\s*id.*//g')" + +# Using current screen orientation proceed to rotate screen and input tools. +case "$rotation" in +normal) + # rotate to the left + xrandr -o left + xsetwacom set "$penstylus" rotate ccw + xsetwacom set "$penerase" rotate ccw + xsetwacom set "$fingertouch" rotate ccw + ;; +left) + # rotate to normal + xrandr -o inverted + xsetwacom set "$penstylus" rotate half + xsetwacom set "$penerase" rotate half + xsetwacom set "$fingertouch" rotate half + ;; +inverted) + # rotate to normal + xrandr -o right + xsetwacom set "$penstylus" rotate cw + xsetwacom set "$penerase" rotate cw + xsetwacom set "$fingertouch" rotate cw + ;; +right) + # rotate to normal + xrandr -o normal + xsetwacom set "$penstylus" rotate none + xsetwacom set "$penerase" rotate none + xsetwacom set "$fingertouch" rotate none + ;; +esac -- cgit v1.2.3