#2150 fix touchscreen and calibration (#2181)

This commit is contained in:
/rootzoll 2021-04-16 02:12:22 +02:00 committed by GitHub
parent 09a4b6325b
commit d3e1831c44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 4 deletions

View file

@ -79,8 +79,10 @@ CHOICE_HEIGHT=11 # 1 line / OPTIONS
OPTIONS=()
OPTIONS+=(t 'Run behind TOR' ${runBehindTor})
OPTIONS+=(s 'Touchscreen' ${touchscreenMenu})
OPTIONS+=(r 'LCD Rotate' ${lcdrotateMenu})
if [ "${displayClass}" == "lcd" ]; then
OPTIONS+=(s 'Touchscreen' ${touchscreenMenu})
OPTIONS+=(r 'LCD Rotate' ${lcdrotateMenu})
fi
OPTIONS+=(a 'Channel Autopilot' ${autoPilot})
OPTIONS+=(k 'Accept Keysend' ${keysend})
OPTIONS+=(n 'Testnet' ${chainValue})

View file

@ -320,7 +320,7 @@ function uninstall_lcd() {
sudo apt-get install -y xinput-calibrator
# remove modifications of config.txt
sudo sed -i "s/^hdmi_force_hotplug=.*//g" /boot/config.txt
sudo sed -i '/^hdmi_force_hotplug=/d' /boot/config.txt 2>/dev/null
sudo sed -i "s/^dtoverlay=.*//g" /boot/config.txt
echo "dtoverlay=pi3-disable-bt" >> /boot/config.txt
echo "dtoverlay=disable-bt" >> /boot/config.txt

View file

@ -21,13 +21,24 @@ fi
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "Turn ON: Touchscreen"
echo "# Turn ON: Touchscreen"
# check that display class is `lcd`
if [ "${displayClass}" != "lcd" ]; then
echo "# displayClass(${displayClass}) is not supported for touchscreen"
echo "error='not supported'"
exit 1
fi
echo "# make sure hdmi_force_hotplug is deactivated"
sudo sed -i '/^hdmi_force_hotplug=/d' /boot/config.txt 2>/dev/null
# update install sources
echo "making sure system dependencies are installed"
sudo apt-get update >/dev/null
sudo apt-get install -y unclutter xterm python3-pyqt5 >/dev/null
sudo apt-get install -y xfonts-terminus >/dev/null
sudo apt-get install -y xinput-calibrator
# check if python3 env exists - if not install it
if [ ! -d /home/admin/python3-env-lnd ]; then
@ -200,6 +211,10 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
echo "switching back to console mode on boot"
sudo raspi-config nonint do_boot_behaviour B2 >/dev/null 2>&1
# make sure hdmi_force_hotplug=1 is added again to config.txt
sudo sed -i '/^hdmi_force_hotplug=/d' /boot/config.txt 2>/dev/null
echo "hdmi_force_hotplug=1" >> /boot/config.txt
# set user pi user for autostart
# TODO(frennkie/rootzoll) what should happen here? This does the same as "on".
sudo sed -i 's/--autologin root/--autologin pi/' /etc/systemd/system/getty@tty1.service.d/autologin.conf