From ce6e58b5e61e7c951bf12ec46ab1031c67c3588a Mon Sep 17 00:00:00 2001 From: Christian Rotzoll Date: Tue, 3 Sep 2019 15:23:02 +0200 Subject: [PATCH] #646 rotate touchscreen --- README.md | 6 ++++-- .../config.scripts/blitz.touchscreen.sh | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e5d26c9d0..e1992157b 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ SHA-256: d62dad4c93b581153554bd02ce7566d37c0d9fd213a7865bc11deb5fe3115b13 if you need details, see here: https://www.raspberrypi.org/documentation/installation/installing-images/README.md -* [How to update my RaspiBlitz?](FAQ.md#how-to-update-my-raspiblitz-after-version-098) +* [How to update my RaspiBlitz?](FAQ.md#how-to-update-my-raspiblitz-from-v12) * [Whats new in Version 1.3 of RaspiBlitz?](FAQ.md#whats-new-in-version-13-of-raspiblitz) ## Boot your RaspiBlitz @@ -144,7 +144,9 @@ If you run into a problem or you have still a question, follow the steps below t 4. Check the RaspiBlot Troubleshoort guide: https://stadicus.github.io/RaspiBolt/raspibolt_70_troubleshooting.html (RaspiBolt is very similar to the RaspiBlitz) -5. If you havent found an answere yet, open a new issue on the RaspiBlitz GitHub. You may have to register an account with GitHub for this. If its a bug with the RaspiBlitz, please add (copy+paste) a Debug Report to your issue (see [FAQ](FAQ.md) how to generate) and/or add some screenshots/photos so the community gets more insight into your problem. +5. There is a Telegram Group of RaspiBlitz users helping each other: https://t.me/raspiblitz + +6. If you havent found an answere yet, open a new issue on the RaspiBlitz GitHub. You may have to register an account with GitHub for this. If its a bug with the RaspiBlitz, please add (copy+paste) a Debug Report to your issue (see [FAQ](FAQ.md) how to generate) and/or add some screenshots/photos so the community gets more insight into your problem. ## Setup Process (Detailed Documentation) diff --git a/home.admin/config.scripts/blitz.touchscreen.sh b/home.admin/config.scripts/blitz.touchscreen.sh index 42a6883c7..8b3c6aec7 100644 --- a/home.admin/config.scripts/blitz.touchscreen.sh +++ b/home.admin/config.scripts/blitz.touchscreen.sh @@ -58,6 +58,22 @@ EOF # Remove 00infoLCD.sh from .bashrc of pi user sudo sed -i s'/exec $SCRIPT/#exec $SCRIPT/' /home/pi/.bashrc + # rotate touchscreen based on if LCD is rotated + if [ "${lcdrotate}" = "1" ]; then + echo "LCD is rotated into default - no touchscreen rotate" + else + echo "Activate Touchscreen Rotate" + cat << EOF | sudo tee /etc/X11/xorg.conf.d/40-libinput.conf >/dev/null +Section "InputClass" + Identifier "libinput touchscreen catchall" + MatchIsTouchscreen "on" + Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1" + MatchDevicePath "/dev/input/event*" + Driver "libinput" +EndSection +EOF + fi + # mark touchscreen as switched ON in config if [ ${#touchscreen} -eq 0 ]; then echo "touchscreen=0" >> /mnt/hdd/raspiblitz.conf @@ -93,6 +109,9 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then # remove old pi autostart sudo rm /home/pi/autostart.sh + # delete possible touchscreen rotate + sudo rm /etc/X11/xorg.conf.d/40-libinput.conf >/dev/null + # mark touchscreen as switched OFF in config sudo sed -i "s/^touchscreen=.*/touchscreen=0/g" /mnt/hdd/raspiblitz.conf