So I just bought an Asus x202e, and have installed Xubuntu 13.04 on it. All working great.

However, I want to be able to rotate the screen from landscape to portrait, and still use the touch. When I currently rotate it, the touch doesn't correspond with it.

How do I fix it?

3 Answers 3


In the end, I found out how to do it, although it's a little tricky. Still, if a non-mega-Geek like me can do it, I'm sure most of you can too! :)

Firstly, Go to Terminal, and type this to find the name of your touchscreen, and if you have one, your touchpad (say, if you have a laptop with a touchscreen):

xinput -list

The names should be pretty obvious for each.

Now, make two "shell scripts": these are little text documents that contain several commands, which are joined up in the document to be done together (effectively creating a little program). Make them using gedit, naming them "portrait.sh" and "landscape.sh" respectively. Save them in a new folder: /home/your username/Scripts/

For PORTRAIT, type this:


#portrait (left)

xrandr -o left
xinput set-prop "Your Touchscreen's Name" --type=float "Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1
xinput set-prop "Your Touchpad's name, if applicable" --type=float "Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1

Next, for LANDSCAPE:


#landscape (normal)

xrandr -o normal
xinput set-prop "Your Touchscreen's Name" --type=float "Coordinate Transformation Matrix" 0 0 0 0 0 0 0 0 0
xinput set-prop "Your Touchpad's name, if applicable" --type=float "Coordinate Transformation Matrix" 0 0 0 0 0 0 0 0 0

If you don't have a touchpad, you can leave out that line of code for each shell script.

Afterwards, I also made launchers to automatically run each shell script when I tapped on them (this is possible in Xubuntu, Ubuntu MATE, and many other Ubuntu flavours). To do so, go to your panel, right-click, click on "add to panel" (or equivalent, for all these subsequent commands, too), create a custom application launcher. For portrait's launcher, put in this command:

sh /home/username/Scripts/portrait

For landscape's launcher, put in this command:

sh /home/username/Scripts/landscape

I also made a "super+" keyboard shortcut for each of them. Find your "keyboard shortcuts" settings program (under Settings in many flavours, or just search for it). Effectively, do the same thing as you did with the panel launchers: Add a new keyboard shortcut, Name it Portrait and give it the command, "sh /home/username/Scripts/portrait", and do the equivalent for Landscape. Then give each of them a keyboard shortcut (say Super+P and Super+L respectively... although be aware Super+P is sometimes the standard keyboard shortcut for your Display Settings).

I STRONGLY recommend you make a keyboard shortcut for LANDSCAPE - that way, if your touch stops working, you can at least get out of Portrait, and back to Landscape successfully (VERY USEFUL).

For more information, go here. http://ubuntuforums.org/showthread.php?t=1972447

(This link - https://wiki.ubuntu.com/X/InputCoordinateTransformation - will also help you understand a little of the theory behind it...)

  • maybe you should accept your answer (and also expand it in case the links die in future?
    – Zanna
    Sep 27, 2016 at 9:07
  • Okay. :) how do I do that? Sep 28, 2016 at 0:23
  • Click on the little grey tick, like this and add some info so we can figure out what to do without visiting external links :)
    – Zanna
    Sep 28, 2016 at 4:58
  • Will that do..? Sep 29, 2016 at 1:08
  • That's wonderful! +1 for your efforts :D
    – Zanna
    Sep 29, 2016 at 5:20

I also wrote a little utility to handle this. Mine is a suite of lowly shell scripts, but they're interfaced and documented fairly well, so I'll add them to the list of solutions here.

You can find the source code here (docs here), and if you're on a Debian derivative, you can install them by adding my package repo here and running sudo apt update && sudo apt install ks-rotate-display.


I've built a little GUI that can do that. Completely based on those open source scripts. Have a look at Screen Orientation Manager here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.