Raspberry Pi met Touch screen roteren

Na veel proberen kwam ik er achter om het volgende te doen voor het roteren van het scherm voor de Touch

Here is my current solution.
It solves everything I need for GUI environment but it’s still showing the splash screen upside down etc.
My solution will only work if you are using autologin to your GUI.

1. Create a file that a) rotate the screen and b) change the input rotation to the same.
Example /usr/local/bin/rotate-180

#!/bin/bash
xrandr --output DSI-1 --rotate inverted
# sleep a while so that the rotation can take affect
sleep 1
# map input to output rotation.
xinput --map-to-output "generic ft5x06 (79)" DSI-1

2. Make it executable.

sudo chmod +x /usr/local/bin/rotate-180

3. Autostart that file when the GUI gets started using a xdg autostart file.
example ~/.config/autostart/rotate-screen.desktop

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=Xrandr DSI-1 1 Rotation
Icon=preferences-desktop-screensaver
Exec=/usr/local/bin/rotate-180
Terminal=false
OnlyShowIn=LXDE;OPENBOX;GNOME;KDE;
Categories=System;Security;Utility;
StartupNotify=false
X-KDE-autostart-after=panel
X-OPENBOX-Autostart-enabled=true

4. Reboot and live happily ever after.


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.