Okay so I got rotation working by editing some random script for a HP laptop. I'm pretty sure this requires the kernel patch and if you don't notice you have to lookup the device id of your touchscreen!
Code:
xinput --list --short
to find that out
So just copy and paste this into a new file, change your device number and save it as rotator.sh wherever
Code:
#!/bin/sh
#
# enhanced rotate script, based on rafiyr's http://ubuntuforums.org/showpost.php?p=9133869&postcount=918
# and others (gathered on forums).
# Added rturn & lturn, to rotate screen left/right a quarter turn at a time (mainly
# because default hp-wmi module was not returning an 'event' for the 'Rotate' button on the bezel of my tx2z).
#
# This script can be 'attached' to a 'rotate' applet on the panel (w. 90° rotation).
# with (for example) command: ...../rotator.sh rturn evdev touch wacom stylus
#
# Usage: rotator.sh direction|position method device [...]
#
# where: direction = (lturn|l|rturn|r|right|left|normal|inverted)
# method = (wacom|evdev)
# device = (stylus|touch)
#
syntax_error=0
orientation=$1
shift
#
# Parse & get current orientation, and do integer conversion (in order to be
# able to (in/de)crement for each 90° rotation, also needed later for 'easier' comparison)
#
current_orientation="$(xrandr -q --verbose | grep 'connected' | egrep -o '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')"
case $current_orientation in
normal)
current_orientation=0
;;
left)
current_orientation=1
;;
inverted)
current_orientation=2
;;
right)
current_orientation=3
;;
esac
#
# Parse the orientation parameter & in case of 'rturn' and 'lturn', check the current
# orientation and make sure that the next value is within bound.
#
case $orientation in
rturn | r)
orientation=$((current_orientation-1))
if [ $orientation -le "-1" ]; then
orientation=3
fi
;;
lturn | l)
orientation=$((current_orientation+1))
if [ $orientation -ge "4" ]; then
orientation=0
fi
;;
normal | 0)
orientation=0
;;
left | 1)
orientation=1
;;
inverted | 2)
orientation=2
;;
right | 3)
orientation=3
;;
* )
syntax_error=1
;;
esac
#
# Check if new orientation is different from current one.
#
if [ $orientation -eq $current_orientation ]; then
echo "Nothing to do."
exit
fi
#
# repeat the device rotation/calibration for all devices passed as parameters
#
# get and (crudely) parse method for errors
method=evdev
#
# get and (crudely) parse device for errors
# and convert device name to number
# LENOVO S10-3t CHANGE ==> Hard Coded my device number to 11!!
device=11
if [ $syntax_error -ne 0 ]; then
echo "Usage: `basename $0` Direction|Orientation Method Device [...]"
echo "\tdirection = (lturn|l)|(rturn|r)|(right|3)|(left|1)|(normal|0|(inverted|2)"
echo "\tMethod: (wacom|evdev)"
echo "\tDevice: (stylus|touch)"
exit 1
fi
#
# Set rotation plane/geometry parameters, and if using "wacom"
# method, also perform device/calibration rotation
#
swap=0
invert_x=0
invert_y=0
real_topx=0
real_topy=0
real_bottomx=4020
real_bottomy=4020
case $orientation in
0)
swap=0
invert_x=0
invert_y=0
topx=$real_topx
topy=$real_topy
bottomx=$real_bottomx
bottomy=$real_bottomy
;;
1)
swap=1
invert_x=1
invert_y=0
topx=$real_topx
topy=$real_topy
bottomx=$real_bottomy
bottomy=$real_bottomx
;;
2 )
swap=0
invert_x=1
invert_y=1
topx=$real_topx
topy=$real_topy
bottomx=$real_bottomx
bottomy=$real_bottomy
;;
3 )
swap=1
invert_x=0
invert_y=1
topx=$real_topx
topy=$real_topy
bottomx=$real_bottomy
bottomy=$real_bottomx
;;
esac
#
# If using "evdev" method, adjust the device (touch/calibration) accordingly
#
if [ $method = "evdev" ]; then
xinput set-prop "$device" "Evdev Axes Swap" $swap
xinput set-prop "$device" "Evdev Axes Swap" $swap
xinput set-prop "$device" "Evdev Axis Inversion" $invert_x $invert_y
xinput set-prop "$device" "Evdev Axis Calibration" $topx $bottomx $topy $bottomy
if [ $orientation = 2 ]; then
xrandr -o inverted
fi
if [ $orientation = 0 ]; then
xrandr -o normal
fi
fi
#
To run the script open up a terminal, go to the directory the script is stored in and type
Code:
sh rotator.sh inverted
and to put it back
Code:
sh rotator.sh normal
It works great on my s10-3t running 10.10 alpha 1... If someone wants to edit this script to get 90-degree rotations working feel free. I really have no need for it.
Bookmarks