Skip to content

Screen rotation

Configure the server to start in the desired orientation, there are many ways to achieve this, here are some examples:

Warning

Rotation is handled by the OS and not by KlipperScreen, if you can't rotate your screen it's usually an issue with the OS configuration

Examples of rotation

Universal xorg configuration

Universal xorg configuration

Find the identifier use xrandr

DISPLAY=:0 xrandr

it will output something like:

Screen 0: minimum 320 x 200, current 1024 x 600, maximum 8192 x 8192
HDMI-1 connected primary 1024x600+0+0 (normal left inverted right x axis y axis) 800mm x 450mm

Take not that the screen is HDMI-1 (it could be HDMI-A-1 or many other names)

Create /usr/share/X11/xorg.conf.d/90-monitor.conf

sudo nano /usr/share/X11/xorg.conf.d/90-monitor.conf
Paste this section modifying the options to suit your needs:
90-monitor.conf
Section "Monitor"
    Identifier "HDMI-1"
    # This identifier would be the same as the name of the connector printed by xrandr
    # for example  "DVI-I-1 connected primary" means that the identifier is "DVI-I-1"
    # another example "Unknown19-1 connected primary" some GPIO screens identify as Unknown19

    Option "Rotate" "left"
    # Valid rotation options are normal,inverted,left,right

    Option "PreferredMode" "1920x1080"
    # May be necesary if you are not getting your prefered resolution.
EndSection
Save the file and restart KlipperScreen.

sudo service KlipperScreen restart

if KlipperScreen doesn't restart:

sudo reboot

you may have to adjust the touch rotation

Raspberry Pi using kernel cmdline

Raspberry Pi using kernel cmdline

To set screen orientation when in console mode, you will need to edit the kernel command-line to pass the required orientation to the system.

sudo nano /boot/firmware/cmdline.txt

To rotate by 90 degrees clockwise, add the following to the cmdline, making sure everything is on the same line, do not add any carriage returns. Possible rotation values are 0, 90, 180 and 270.

For example a DSI screen:

video=DSI-1:800x480@60,rotate=90

To find the identifier on a terminal run:

DISPLAY=:0 xrandr
it will output something like:

Screen 0: minimum 320 x 200, current 1024 x 600, maximum 8192 x 8192
HDMI-1 connected primary 1024x600+0+0 (normal left inverted right x axis y axis) 800mm x 450mm

in this case the identifier is HDMI-1 and a simple cmdline arg would be something like:

video=HDMI-1:1024x600@60

To apply changes do a reboot:

sudo reboot
Read the official docs for more info

Raspberry Display docs

Raspberry Pi legacy mode (works with vc4-fkms-v3d)

Raspberry Pi legacy mode (works with vc4-fkms-v3d)

add to config.txt

display_lcd_rotate=2

To apply changes do a reboot:

sudo reboot

Warning

At the moment of writing Pi4 didn't support 90 and 270 degrees with this method, see the official docs

Value result
0 no rotation
1 rotate 90 degrees clockwise
2 rotate 180 degrees clockwise
3 rotate 270 degrees clockwise
0x10000h horizontal flip
0x20000 vertical flip

Read the official docs for more info

Using a screen installed with goodtft-LCD-show

Using a screen installed with goodtft-LCD-show

cd LCD-show/
sudo ./rotate.sh 90
Using Waveshare screen that is installed with LCD-show

Using Waveshare screen that is installed with LCD-show

cd LCD-show/
sudo ./LCD43-show 270 lite

Touchscreen touch rotation

See touch rotation