Rotate display with touch panel like tablet PC.
- ASUS Vivobook flip 12 TP203NA
- xubuntu 19.04
git clone https://github.com/fllt/rotate-tabletpc.git
This script is written for my TP203NA. So, if you use on other devices,you need to fix some variants.
$ xinput list
Result on TP203NA
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ELAN24C9:00 04F3:24C9 id=11 [slave pointer (2)]
⎜ ↳ ELAN1201:00 04F3:3054 Touchpad id=13 [slave pointer (2)]
⎜ ↳ ELAN24C9:00 04F3:24C9 Pen (0) id=18 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Asus Wireless Radio Control id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ USB2.0 VGA UVC WebCam: USB2.0 V id=10 [slave keyboard (3)]
↳ ELAN24C9:00 04F3:24C9 id=12 [slave keyboard (3)]
↳ Asus WMI hotkeys id=14 [slave keyboard (3)]
↳ gpio-keys id=15 [slave keyboard (3)]
↳ gpio-keys id=16 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=17 [slave keyboard (3)]
In this case, id=11 and id=18 are need to rotate because they are touchdisplay.(One is multi touch and another is stylus.)
id=13 is need to disable because it is Touchpad under keybourd. (Key board is not enable. Because on TP203NA, keybourd is automatically disabled when it is tablet mode.)
$ xrandr --listmonitors
Result on TP203NA
Monitors: 1
0: +eDP-1 1366/256x768/144+0+0 eDP-1
In this case, use eDP-1 . Although, unlike input devices, it is hard to imagine that embedded more than one display. So, I think that basically you can use eDP-1 .
Fix berow section besed on checked values.
input_rotate=(11 18) #Touch display for finger and stylus
input_disable=(13) #Touchpad
output="eDP-1"
cd rotate-tabletpc
cp rotate-tabletpc.sh ~/bin/
rotate-tabletpc.sh
Whenever you run, display rotation is switched between normal and left.
I recomend to set the comannd to keybourd shortcuts or Launcher.
rm ~/bin/rotate-tabletpc