x380 yoga
dmesg
Rotate display and map pen and finger touch correctly
usage
rotate.display - return to default
rotate.display i - rotates by 180°
rotate.display l - rotates by 270°
rotate.display r - rotates by 90°
files
rotate.display
#!/bin/ksh
#see `xinput --list' to see what devices to put here
#this only operates with the pen and finger touch on x380 yoga
dp_name=eDP-1
case $1 in
i) xrandr --output "$dp_name" --rotate inverted
xinput set-prop "Wacom Pen and multitouch sensor Pen stylus" --type=float\
"Coordinate Transformation Matrix" -1 0 1 0 -1 1 0 0 1
xinput set-prop "Wacom Pen and multitouch sensor Finger touch" --type=float\
"Coordinate Transformation Matrix" -1 0 1 0 -1 1 0 0 1;;
l) xrandr --output "$dp_name" --rotate left
xinput set-prop "Wacom Pen and multitouch sensor Pen stylus" --type=float\
"Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1
xinput set-prop "Wacom Pen and multitouch sensor Finger touch" --type=float\
"Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1;;
r) xrandr --output "$dp_name" --rotate right
xinput set-prop "Wacom Pen and multitouch sensor Pen stylus" --type=float\
"Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1
xinput set-prop "Wacom Pen and multitouch sensor Finger touch" --type=float\
"Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1;;
*) xrandr --output "$dp_name" --rotate normal
xinput set-prop "Wacom Pen and multitouch sensor Pen stylus" --type=float\
"Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1
xinput set-prop "Wacom Pen and multitouch sensor Finger touch" --type=float\
"Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1;;
esac