aboutsummaryrefslogtreecommitdiff
path: root/install.sh
blob: 1061ec8f69c6da1f36cc158245e990a57472c8fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash


# For checking version numbers greater than or equal.
check_ver_lte() {
    [  "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}


chmod +x *.sh *.py
sudo patch -b /boot/config.txt 7inch.patch
sudo apt-get install -y python3-pip libudev-dev
# sudo pacman -S python python-pip  libudev0 gcc
sudo pip-3.2 install python-uinput pyudev
#if pip-3.2 can't be found, please use pip3
#sudo pip3 install python-uinput pyudev

PYTHON_VERSION=`python3 -c 'import sys; print(".".join(map(str, sys.version_info[:3])))'`
if check_ver_lte "3.4" $PYTHON_VERSION; then
    echo "Python $PYTHON_VERSION detected - using async driver."
    sudo cp touch_async.py /usr/bin/touch.py
else
    sudo cp touch.py /usr/bin/
fi
sudo cp touch.sh /etc/init.d/

sudo chmod +x /usr/bin/touch.py
sudo chmod +x /etc/init.d/touch.sh

sudo update-rc.d touch.sh defaults