Skip to content

Instantly share code, notes, and snippets.

@Galarzaa90
Last active February 22, 2017 17:12
Show Gist options
  • Save Galarzaa90/3281f798b2c2e8312ff3b402397967fa to your computer and use it in GitHub Desktop.
Save Galarzaa90/3281f798b2c2e8312ff3b402397967fa to your computer and use it in GitHub Desktop.
Script to rotate the touch screen driver on Raspberry Pi official touchscreen.
#!/bin/bash
#script to set correct touchscreen orientation after x start
#this won't rotate the displayed image, only the touchscreen input
#to rotate the displayed image add the following to /boot/config.txt
#"display_rotate=1" to rotate display 90 degrees
#"display_rotate=3" to rotate display 270 degrees
# To execute this script on boot, add the following line:
#@/path/to/file/screenflip.sh
#to (Wheezy):
#/etc/xdg/lxsession/LXDE-pi/autostart
#to (Jessie):
#~/.config/lxsession/LXDE-pi/autostart
xinput set-prop 'FT5406 memory based driver' 'Evdev Axes Swap' 1
#Uncomment this for 90 rotation
xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 0 1
#Uncomment this for 270 rotation
#xinput --set-prop 'FT5406 memory based driver' 'Evdev Axis Inversion' 1 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment