Linux —How to Rotate Display and Touchscreen
2025/12/12 updated |By G editor
In the past, Raspberry Pi users often encountered the problem of the touchscreen not rotating synchronously when the display was rotated to portrait mode. However, since 2025, many Linux graphical desktops have supported automatic touchscreen rotation settings. This is no longer an issue for Linux users.
This article demonstrates how to configure portrait display settings on several popular Linux desktops, as well as how to customize the touch tranfomation matrix for legacy X11 desktop environments. This addresses the needs of users requiring portrait-oriented touch operations in kiosks, navigation systems, or industrial control applications.
1. Gnome Desktop
Gnome is a highly popular Linux desktop environment, providing a graphical display settings interface for easy rotation of the display orientation. Since 2025, after setting the display to portrait mode, Gnome desktop will automatically rotate the touch position, enabling immediate and accurate touch operations.
① Open 'Settings'
Click the top left corner to bring up the taskbar >> List all applications >> Click 'Settings'
② Set 'Orientation'
Click [Displays] in the sidebar >> click Orientation menu >> select the display orientation >> click on [Apply] >> click on [Keep Changes]
③ Portrait display & touch OK!
2. Plasma Desktop
Plasma's clean and practical design has earned it a loyal following. Plasma's graphical support is comparable to GNOME's. Its graphical display settings interface not only allows rotation of the display orientation but also offers dual-screen and touchscreen configuration options. Since 2025, after setting the display to portrait orientation, Plasma desktop will automatically rotate the touch position, enabling immediate and accurate touch operations.
① Open 'System Settings'
Click the System Settings icon in the bottom-left corner >> Select [Display & Monitor] in the sidebar to view connected display information.
② Set 'Orientation'
Tap the icon in [Orientation] to select the desired screen display orientation >> Tap [Apply] >> Tap [Keep]
③ Portrait display & touch OK!
3. Ubuntu Desktop
Ubuntu's highly graphical interface and stability make it the top choice for Linux laptop users. The Ubuntu desktop offers a graphic display-settings interface for easy rotation of the display orientation. Since 2025, after setting display to portrait mode, Ubuntu desktop will automatically rotate the touch position for immediate and accurate touch operation.
① Open 'System Settings'
Tap the bottom-left corner to bring up the list of all apps >> Tap 'Settings'
② Set 'Orientation'
Click [Displays] in the sidebar >> Click the Orientation menu >> Select the display orientation >> Click [Apply] >> Click [Keep Changes]
③ Portrait display & touch OK!
4. Manual Settings of Touch Transformation Matrix
If you use an older desktop environment (e.g., Plasma X11) and find that the touch position is still horizontal after setting the display to portrait mode, you can manually set the touch transformation matrix. The setting method is as follows:
① Enter xorg.conf.d Folder
Key in the followins in Terminal
〖 cd /usr/share/X11/xorg.conf.d〗
② Search for libinput File
Key in〖 ls〗 to list alll the files in this folder
③ Open 40-libinput File
Key in〖sudo nano 40-libinput.conf〗
Find the section of touchscreen's InputClass and keyin〖Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1" 〗
The values of Tranformation Matrix of Gechic T1 touch monitors:
0° = Option "TransformationMatrix" "1 0 0 0 1 0 0 0 1"
90° = Option "TransformationMatrix" "0 -1 1 1 0 0 0 0 1"
180° = Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1"
270° = Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
Note: The above values are based on clockwise rotation angles. The XY origin points may vary across different brands/models of touchscreens, so the transformation matrix values for 90° and 270° may be exactly opposite. For models other than Gechic, please try them to confirm!
④ Reboot
Key in〖 sudo reboot〗
After rebooting, the touch position responses correctly.




