This quick tutorial will help you rotate displays using a terminal and a GUI.
If you are using a tab, touchscreen laptop, or any other device whose display can be rotated for different use cases and if it is running Ubuntu or any Linux – rotating a display can be tricky.
The usual settings dialogs (e.g. in Ubuntu 22.04 LTS) don’t give you the option to rotate the screen display. The basic install of the latest Ubuntu gives the below options:
- Changing the resolutions
- And modify the scaling
If you use any virtual machine such as virt-manager, sometimes you don’t get the above settings. And you might be stuck with a low-resolution screen.
However, you can still use xrandr, an official configuration utility for RandR (Resize and Rotate). This utility can be used in any Linux distribution and helps you resize, rotate, manage multiple displays, etc.
This is how you can use this utility to rotate displays.
How to Rotate Display in Ubuntu Linux
There are two ways. You can use the graphical UI of xrandr or use the terminal.
Open terminal (CTRL+ALT+T) and below commands as per your need.
Xrandr should be installed by default in your OS.
To rotate left:
xrandr -o left
To rotate right:
xrandr -o right
To rotate upside down:
xrandr -o inverted
To go back to normal:
xrandr -o normal
Install the utility arandr (an acronym for “Another XRandR GUI”) from the command line via the below commands:
apt install arandr
dnf install arandr
Once installed, open the application.
You can now choose any display resolution, rotate option from the utility,
This GUI also can help you to manage multiple displays as well.
More Usage of xrandr
Xrandr is a powerful utility. Apart from the above usage, you can use the below commands to perform specific needs.
Show information about your display
xrandr --output eDP-1 --mode 1920x1080
eDP-1 is the identification of your monitor/display which you can find out while running the first command xrandr -q.
Change resolution with a refresh rate
xrandr --output eDP-1 --mode 1920x1080 --rate 60.00
Change resolution and refresh rate in dual-screen setup
xrandr --output DisplayPort-0 --mode 1920x1080 --rate 144.00 --output eDP-1 --mode 1920x1080 --rate 60.00
Change resolution and refresh rate in a dual-screen setup with a primary display
xrandr --output DisplayPort-0 --primary --mode 1920x1080 --rate 144.00 --output eDP-1 --mode 1920x1080 --rate 60.00 --right-of DisplayPort-0
Change Display Using Arandr – Video
We have prepared a video for you to show how you can change and play around with display attributes using arandr.