root@teamhd: xrandrScreen 0: minimum 320 x 200, current 800 x 1280, maximum 8192 x 8192HDMI-1 disconnected primary (normal left inverted right x axis y axis)DSI-1 connected 800x1280+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
800x1280 59.99*+
在 ~/.xprofile 中添加以下内容,设备 ID 在每次重启或重新连接设备时可能会发生变化,所以需要创建动态脚本
# Rotate screen
xrandr --output DSI-1 --rotate right# Find the device ID for the touch screen using its nameTOUCHSCREEN_ID=$(xinput list |grep-i'goodix-ts'|awk -F'id=''{print $2}'|awk'{print $1}')# Check if the ID was found and set the coordinate transformation matrixif[-n"$TOUCHSCREEN_ID"];thenxinput set-prop $TOUCHSCREEN_ID"Coordinate Transformation Matrix"010-101001elseecho"Touchscreen not found"fi
赋予.xprofile 文件可执行权限,并更新配置使其立即生效
sudochmod +x ~/.xprofilesource ~/.xprofile
方法二、使用 xorg.conf 文件配置屏幕/触摸旋转
执行 xrandr 命令查看当前连接的显示器及其名称
root@teamhd: xrandrScreen 0: minimum 320 x 200, current 800 x 1280, maximum 8192 x 8192HDMI-1 disconnected primary (normal left inverted right x axis y axis)DSI-1 connected 800x1280+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
800x1280 59.99*+