User Tools

Site Tools

한국어

comfilepi:rotate_the_screen:index

Rotating the ComfilePi's Screen

Bookworm and Later (Wayland)

It is easiest to rotate the touchscreen from the terminal command line. Use the following procuedure:

  • Run the command wlr-randr –output HDMI-A-1 –transform 90 to immediately rotate the screen. Use 0, 90, 180, or 270 to specify the orientation.
  • Add video=HDMI-A-1:800x480M@60,rotate=90 to /boot/firmware/cmdline.txt to ensure the screen is rotated while booting. Use 0, 90, 180, or 270 to specify the orientation.
  • After rotating the screen recalibrate the touchscreen to ensure the touchscreen follows the new orientation.

X11

If using X11 (a.k.a. XWindows) you can add a transformation matrix instead of recalibrating the touchscreen.

# 90-degree clockwise rotation
xinput set-prop "Microchip Technology Inc. AR1100 HID-MOUSE" "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1
 
# 90-degree counterclockwise rotation
xinput set-prop "Microchip Technology Inc. AR1100 HID-MOUSE" "Coordinate Transformation Matrix" 0 -1 1 1 0 0 0 0 1
 
# 180-degree rotation
xinput set-prop "Microchip Technology Inc. AR1100 HID-MOUSE" "Coordinate Transformation Matrix" -1 0 1 0 -1 1 0 0 1

To apply the setting each time the panel PC boots into X Windows, create a file in the /etc/X11/xorg.conf.d/ like /etc/X11/xorg.conf.d/01-touchscreen-rotation.conf with contents similar to the following:

Section "InputClass"
    Identifier "AR1100 Transformation Matrix"
    MatchProduct "Microchip Technology Inc. AR1100 HID-MOUSE"
    Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1"
EndSection
comfilepi/rotate_the_screen/index.txt · Last modified: by mfranklin