查看显示屏参数
xrandr
firefly@firefly:~$ xrandr
Screen 0: minimum 0 x 0, current 3840 x 1202, maximum 32768 x 32768
default connected primary 3840x1202+0+0 1015mm x 318mm
3840x1202 0.00*
修改配置文件
- 配置文件:/etc/X11/xorg.conf
sudo vim /etc/X11/xorg.conf
如果不存在xorg.conf文件的话直接在/etc/X11/路径下创建该文件即可。将文件内容修改如下:
Section "Monitor"
Identifier "HDMI-1"
Option "Rotate" "normal"
EndSection
Section "Screen"
Identifier "Screen0"
Monitor "HDMI-1"
Option "RandRRotation"
EndSection
Section "ServerLayout"
Identifier "DefaultLayout"
Screen "Screen0"
EndSection
Section "InputClass"
Identifier "touchscreen"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "SwapAxes" "true"
Option "InvertX" "false"
Option "InvertY" "true"
EndSection
参数说明如下:
Section "Monitor"
Identifier "HDMI-1" #设置默认显示器为HDMI-1
Option "Rotate" "normal" #设置屏幕旋转 normal为正常,left向左旋转90度,
#right向右旋转90度,inverted为上下翻转
EndSection
Section "Screen"
Identifier "Screen0"
Monitor "HDMI-1" #设置屏幕为HDMI-1
Option "RandRRotation" #设置支持HDMI旋转
EndSection
Section "InputClass"
Identifier "touchscreen" #触摸屏设置
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "SwapAxes" "true"
Option "InvertX" "false" #设置触摸屏X轴旋转,true为开启,false为关闭
Option "InvertY" "true" #设置触摸屏Y轴旋转,true为开启,false为关闭
EndSection