Rotating screen in Ubuntu and Linux Mint

Just as in Windows you have the option to rotate your screen into any direction in Linux, too. While in Windows you only need to press some keys, a key combination is not configured in Linux by default. But as you may have figured out, there are some terminal commands that let you do the exact same thing (you can configure shortcuts for these manually later on).

First, you need to find out how the screen that you want to rotate is labeled - to do that, use the following command:

xrandr -q

Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.1*+
1360x768 59.8 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA2 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)

You will get a list of connected monitors - I have only one here which is labeled LVDS1, it says connected next to the name. Determine the one that you want to rotate here. Next, we want to turn it around. For that, we use one of the following commands:

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

Replace LVDS1 with your monitor label in the above commands and you'll be able to rotate the screen to your likings! This is especially helpful if you need to go through documents and can turn your physical monitor around.

22 thoughts on “Rotating screen in Ubuntu and Linux Mint”

  1. I did
    xrandr -o left
    and it did fine.

    But next time that I start my computer, it is again in landscape mode. So now I must rotate the monitor every time to start the terminal mode, enter this instruction and rotate the screen back into vertical position.
    How can I set the preferred rotation permanenty?

    Thanks, Erik

  2. All diconected in the hp pavilio x360 (argh!). Ubuntu 15:

    DP1 disconnected (normal left inverted right x axis y axis)
    HDMI1 disconnected (normal left inverted right x axis y axis)
    HDMI2 disconnected (normal left inverted right x axis y axis)
    VGA1 disconnected (normal left inverted right x axis y axis)
    VIRTUAL1 disconnected (normal left inverted right x axis y axis)

  3. it works, rotated the screen to the left. but now my mouse movements are strange. up is left, down is right, etc. it is a mesh! how can you keep a well working mouse?

    • Use xinput:
      #apt-get install xinput

      then find your mouse or touch device name
      #xinput –list

      then use this command where you replace Mouse or Touch Device Name with the name given by the previous command

      #xinput –set-prop ‘Mouse or Touch Device Name’ ‘Evdev Axes Swap’ 1
      #xinput –set-prop ‘Mouse or Touch Device Name’ ‘Evdev Axis Inversion’ 0 1

  4. Why not just click on [System Settings], then [Displays], then [Rotation] and pick from the pull down menu the orientation you want the display to display as?

    Simple, Right?

  5. Hello, my hp pavilion x360 suddenly have vertical rotation just from login. In grafic mode I change orientation as normal, but just next start system orientation again vertical. How I can fix it?

  6. Really baffled about how to do this for an ASUS T100 Transformer 2-in-1 with Linux Mint 17.x, and now 18.3. It seems to have a “native” portrait orientation of 800×1280.

    Once I got it set to always rotate to landscape at start-up with Mate menu, Preferences/Displays, that was good .

    However, that left the touchscreen mouse pointer in an uncorrected orientation. I finally tracked down xinput-calibrator (sudo apt-get install xinput-calibrator). Then just running it in a terminal session (no parameters/arguments) overlaid the screen with a blank screen and progressively showing a cross-hair in each corner to be tapped (with finger worked fine). After the 4th cross-hair/tap, it cleared that overlay, and dropped back to the terminal session with these directions:


    Setting calibration data: 0, 4095, 0, 4095
    Calibrating EVDEV driver for “SIS0457:00 0457:1133” id=14
    current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095

    Doing dynamic recalibration:
    Inverting X and/or Y axis…
    Setting calibration data: 4121, -15, 38, 4157
    –> Making the calibration permanent <–
    copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
    Section "InputClass"
    Identifier "calibration"
    MatchProduct "SIS0457:00 0457:1133"
    Option "Calibration" "4121 -15 38 4157"
    Option "SwapAxes" "1"

    For my setup it needed the 2nd directory to be used:


    Copy pasted the "Section" settings as shown into that (new) file, and it was good to go from there on (through 3 reboots so far…).


  7. Thanks for all your experience, does anyone found a way to get this automated, I have a acer aspire r which can flip over, back in the days… with windows this screen output would adapt to the screen physical position
    any chance you guys found a way to replicate th

  8. I can confirm that “xrandr -o left” and “xrandr -o normal” works for Linux Mint 19.2 and a single Dell U2412M monitor.
    I’ve also set up two custom keyboard shortcuts for the two commands to be able to change the rotation instantly: Shift+[Mod4 aka the useless Windows key]+[arrow left] to rotate vertically and Shift+[Windows key]+[arrow up] to restore to normal. Works like a charm and now I can read full page comics 🙂


Leave a Comment