From 6321185e4f07a087d464bffe930e606c5a6b14fa Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 2 Sep 2020 18:18:01 +0200 Subject: [PATCH] #1436 switch touchscreen rotate --- home.admin/config.scripts/blitz.lcd.sh | 32 +++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/home.admin/config.scripts/blitz.lcd.sh b/home.admin/config.scripts/blitz.lcd.sh index 9e4e6546c..1153be545 100644 --- a/home.admin/config.scripts/blitz.lcd.sh +++ b/home.admin/config.scripts/blitz.lcd.sh @@ -92,8 +92,19 @@ elif [ "${command}" == "rotate" ]; then fi sudo sed -i "s/^lcdrotate=.*/lcdrotate=1/g" /mnt/hdd/raspiblitz.conf - # delete possible touchscreen rotate - sudo rm /etc/X11/xorg.conf.d/40-libinput.conf >/dev/null + # if touchscreen is on + if [ "${touchscreen}" = "1" ]; then + echo "Also rotate touchscreen ..." + 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 echo "# OK - a restart is needed: sudo shutdown -r now" @@ -109,21 +120,10 @@ elif [ "${command}" == "rotate" ]; then fi sudo sed -i "s/^lcdrotate=.*/lcdrotate=0/g" /mnt/hdd/raspiblitz.conf - # if touchscreen is on - if [ "${touchscreen}" = "1" ]; then - echo "Also rotate touchscreen ..." - 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 + # delete possible touchscreen rotate + sudo rm /etc/X11/xorg.conf.d/40-libinput.conf >/dev/null - echo "OK - a restart is needed: sudo shutdown -r now" + echo "OK - a restart is needed: sudo shutdown -r now" else echo "error='missing second parameter - see help'"