Rotate only one screen

If I have only the internal monitor (LVDS1) with an xrandr -o left command. Now I want to attach a second monitor, say to HDMI1. Then I'd like to rotate only the internal monitor, but not the external one. I tried the following (with no external attached though, since I am mobile currently), but that does not do anything:

xrandr --output LVDS1 -o left

How can I rotate only one monitor?

I do need some command line, since I want to put this into a script.


The trick is to use the newer --rotate instead of -o which needs to be used with a --output argument:

xrandr --output "$internal" --rotate "$xrandr_rotation"

Examples

xrandr --output LVDS1 --rotate left
xrandr --output LVDS1 --rotate right
xrandr --output LVDS1 --rotate normal
xrandr --output LVDS1 --rotate inverted

If you open the System Settings and choose Displays there, you can select the monitor to rotate, and choose which rotation to use, for each individual monitor you wish to rotate.