修改屏幕的顯示方向:
在終端輸入
xrandr -o left 向左旋轉90度
xrandr -o right 向右旋轉90度
xrandr -o inverted 上下翻轉
xrandr -o normal 回到正常角度
或
打開設置中的Displays也可以設置
永久保存屏幕顯示方向:
終端輸入
sudo gedit /etc/X11/Xsession.d/55gnome-session_gnomerc
在打開的文件末端添加
xrandr --output Virtual1 --rotate left
保存即可
left 指屏幕左旋轉90度
驗證過程
1) .bashrc 終端啓動時改變
2) /etc/profile 一閃而過
3)/etc/X11/Xsession.d/55gnome-session_gnomerc 一閃而過
4) /usr/share/X11/xconf.d/40-monitor 一閃而過
活/etc/X11/xorg.conf.d/40-monitor.conf
xrandr (x11-apps/xrandr) can rotate Xorg output at runtime, but the best practice is to rotate the display when Xorg is initialized and before anything is rendered.
First determine the name of you display output by running xrandr while Xorg is active. Look for a line like HDMI1 connected....
Then add a Rotate
option to the monitor section of 40-monitor.conf configuration file
Section "Monitor"
# This identifier would be the same as the name
# of the connector printed by xrander.
Identifier "eDP1"
Option "Rotate" "left"
Option "PreferredMode" "1920x1080"
# A line such as this ^ may be necesary if you
# are not getting your prefered resolution.
# These numbers need not be reversed with tallscreen orientation.
EndSection
Frame buffer or modesetting rotation
upport for framebuffer rotation must be enabled in the kernel (this is not required for rotation using Xorg).
KERNEL
Device Drivers --->
Graphics support --->
Console display driver support --->
[*] Framebuffer Console Rotation
The fbcon
kernel boot option is used to rotate the kernel frame buffer at boot time.
/usr/src/linux/Documentation/fb/fbcon.txt
fbcon=rotate:<n>
This option changes the orientation angle of the console display. The
value 'n' accepts the following:
0 - normal orientation (0 degree)
1 - clockwise orientation (90 degrees)
2 - upside down orientation (180 degrees)
3 - counterclockwise orientation (270 degrees)
If you wish to rotate your display to the right and are using GRUB-0, append the option fbcon=rotate:1
to the kernel
lines in /boot/grub/grub.cfg
To perform the same rotation with GRUB2, append fbcon=rotate:1
to the GRUB_CMDLINE_LINUX variable in /etc/default/grub and execute the grub-mkconfig command:
root #
grub-mkconfig -o /boot/grub2/grub.cfg
The screen should be reoriented on the next boot, assuming the kernel has been compiled with rotation support.
參見https://wiki.gentoo.org/wiki/Tallscreen_Monitor
https://forum.ubuntu.org.cn/viewtopic.php?t=484620
GNOME方案
GNOME(lightdm)永久保存屏幕方向
1、在設置中顯示中設置方向 ,左旋轉,應用
2、在終端執行命令 gsettings set org.gnome.settings-daemon.plugins.orientation active false
參見
https://askubuntu.com/questions/968169/screen-randomly-rotates-on-ubuntu-17-10
https://blog.csdn.net/weixin_30614587/article/details/98921654
https://blog.csdn.net/zhao_ru_jie/article/details/86517348