← Back to team overview

toshiba-tablet team mailing list archive

A first stab at an excellent rotation script

 

Below is a first stab at a script to rotate the tablet input and
output in unison.  There's several such versions floating around the
internet, this one is unique in that it supports all four
orientations.  There are obvious improvements to be had, but it at
least works as intended on my tablet.

Justin Dugger

----

#!/bin/sh
rotation=`xrandr -q --verbose | grep "^default connected" | cut -d" " -f5`

echo $rotation;

case "$rotation" in
   'normal')
      xrandr -o inverted
      xsetwacom set stylus rotate half
         ;;
   'inverted')
      xrandr -o left
      xsetwacom set stylus rotate 2
         ;;
   'left')
      xrandr -o right
      xsetwacom set stylus rotate 1
         ;;
   'right'	)
      xrandr -o normal
      xsetwacom set stylus rotate 0
         ;;
esac



Follow ups