Last active
December 30, 2017 16:50
-
-
Save dw5/59c6c7d08584ab9d16e58c83d4298225 to your computer and use it in GitHub Desktop.
linux tablet touch fix when rotated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script rotates the screen and touchscreen input 180 degrees, disables the touchpad, and enables the virtual keyboard | |
# And rotates screen back if the touchpad was disabled | |
# experimental / source: https://www.reddit.com/r/linux4noobs/comments/539fw5/how_would_i_rotate_the_touch_screen_in_linux/ | |
# to get device list "xinput list" | |
isEnabled=$(xinput --list-props 'SynPS/2 Synaptics TouchPad' | awk '/Device Enabled/{print $NF}') | |
if [ $isEnabled == 1 ] | |
then | |
echo "Screen is turned upside down" | |
xrandr -o inverted | |
xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1 | |
xinput disable 'SynPS/2 Synaptics TouchPad' | |
# Remove hashtag below if you want pop-up the virtual keyboard | |
# onboard & | |
else | |
echo "Screen is turned back to normal" | |
xrandr -o normal | |
xinput set-prop 'ELAN Touchscreen' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1 | |
xinput enable 'SynPS/2 Synaptics TouchPad' | |
# killall onboard | |
fi |
Author
dw5
commented
Dec 30, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment