1. Overview
Sometimes, we may want to rotate the display in Linux to optimize the system view. Specifically, we can perform this task when we need to utilize vertical monitors or experiment with different rotation angles. Resultantly, this function might provide a more comfortable and visually appealing experience.
In this tutorial, we’ll check some of the easiest ways to rotate the display in Linux using the xrandr command, System Settings, and the ARandR tool.
Notably, the examples involve setting display orientation on a Ubuntu 24.04 GNOME desktop.
2. Using the xrandr Command
xrandr is a well-known command-line utility used to view and set the refresh rates, and display size, and fix other monitor-related issues. Additionally, we can use it to change the screen orientation of the system as a whole.
For instance, let’s first use the xrandr command to rotate the display to the left:
$ xrandr -o left
In the script above, we pass the -o option to specify left as the desired display rotation.
Let’s check the result:
Consequently, we successfully rotate the display 90 degrees counterclockwise to the left.
Likewise, we run the xrandr command to rotate the display to the right:
$ xrandr -o right
The result is as expected:
Thus, we now see the display 90 degrees clockwise to the right.
Further, we run xrandr with the inverted option to rotate the display 180 degrees or upside down:
$ xrandr -o inverted
Finally, we can restore the view with the xrandr command via the normal option:
$ xrandr -o normal
As a result, we reset the display to its default orientation.
3. Using System Settings
Most desktop environments including GNOME offer a graphical user interface (GUI) Settings application for managing display settings. More specifically, we can use it to change the orientation of the system display as per the current requirements.
To do so, we bring up the Activities menu, type Settings, and launch the application:
From the left side, we navigate to the Displays tab and click on Orientation:
By default, the Orientation of most Linux systems is set as Landscape. However, we now change it to Portrait Right and click Apply:
From the on-screen confirmation box, we click the Keep Changes button to save the modified display settings:
Let’s check the result:
Thus, we successfully rotate the system display to the right.
Likewise, we repeat the same steps and set the Orientation to Portrait Left mode to rotate the system display to the left:
Further, we change the Orientation to Landscape (Flipped) to flip the display upside down:
Finally, we revert the Orientation to the Landscape mode:
Thus, we successfully rotate the system display to normal mode.
4. Using the ARandR Tool
In Linux, ARandR or Another XRandR GUI provides a front-end for the xrandr command. It’s primarily used to manage the display settings, particularly for multi-monitor setups.
Moreover, we can use the ARandR tool to rotate the system display.
Before doing so, we first install the arandr package via apt:
$ sudo apt install arandr
After a successful installation, we launch the Activities menu, type ARandR, and open the application:
Next, we right-click on the Virtual1 machine, extend the Orientation drop-down menu, and select the right option:
After that, we switch to the Layout menu and click Apply. Additionally, we can also press Ctrl+Return to save the added changes:
Let’s check the result:
Consequently, we set the system display orientation to the right.
Similarly, we can reset the display rotation to inverted, left, or back to normal using the same Orientation menu:
As a result, the changes reflect the display orientation of the system.
5. Conclusion
In this article, we learned different methods to rotate the display in Linux. These methods included using the xrandr command, System Settings, and the ARandR tool.
Along with its many other functions, we can use the xrandr command to set the display rotation through the terminal. Furthermore, the ARandR tool which is a front-end of xrandr performs the same operation through GUI. On the other hand, System Settings enables us to set the system orientation using the built-in Linux settings.
Ultimately, we can select any of these efficient methods based on the current display preferences.