#!/bin/bash
# zenity --password --title="sudo password prompt" --timeout=10 > /tmp/pass.txt
# password=`cat /tmp/pass.txt`
# echo $password
pwd=`pwd`
pwd_='pwd'
echo $pwd
filename="yoovo.desktop"
sed -i "s|$pwd_|$pwd|g" $filename
echo '#!/bin/bash' > run.sh
echo 'cd '$pwd >> run.sh
echo "python3 yoovo.py" >> run.sh
chmod +x run.sh
cp $filename ~/.config/autostart/
pi_arch=`uname -m`
if [[ $pi_arch -eq 'armv7l' ]]
then
	rm compiled_gui_64.so
	mv compiled_gui_32.so compiled_gui.so
else
	rm compiled_gui_32.so
	mv compiled_gui_64.so compiled_gui.so
fi
sudo apt-get install software-properties-common -y
sudo apt update
sudo apt install python3-dev python3-pip -y
sudo apt-get install python3-pil python3-pil.imagetk -y
python3 -m pip install -r requirements.txt
# echo $password | sudo -S systemctl daemon-reload
# echo $password | sudo -S systemctl enable $filename
# echo $password | sudo -S systemctl start $filename