summaryrefslogtreecommitdiff
path: root/autologin.sh
diff options
context:
space:
mode:
authorLuca Tringali <tringalinvent@libero.it>2019-01-23 15:39:48 +0100
committerLuca Tringali <tringalinvent@libero.it>2019-01-23 15:39:48 +0100
commitfbf4af0fe73a8da8fc8924ea7466d85331b9fb46 (patch)
treeab2b6ec3a1e3d263a2d78841c3184882f18bcc01 /autologin.sh
parentf728342b730a236dd6e648e3f0dfee1028dbd293 (diff)
Comments and README
Diffstat (limited to 'autologin.sh')
-rwxr-xr-x[-rw-r--r--]autologin.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/autologin.sh b/autologin.sh
index f7135b3..ce265e7 100644..100755
--- a/autologin.sh
+++ b/autologin.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+#Created by Luca Tringali - www.codice-sorgente.it
+#Thanks to Dalen, this code is based on his answer: https://stackoverflow.com/questions/44186905/how-to-replace-the-desktop-interface-with-a-python-application
+
username="pi"
cat <<EOF > /etc/systemd/system/tty1.service
[Service]
@@ -41,9 +44,18 @@ sleep 1
/usr/bin/python3 /home/$username/termostato-raspberry/termostato.py
EOF
chmod +x /home/$username/appstart
+chmod +x /home/$username/termostato-raspberry/termostato.py
chown $username:$username /home/$username/appstart
+#This thermostat app also needs the following libraries:
+sudo apt-get update
+sudo aptitude install python3-rpi.gpio
+sudo pip3 install w1thermsensor
+
+#Disable old autologins, give user access to tty
sudo systemctl disable sddm.service
+sudo systemctl disable getty.target
+sudo systemctl disable getty@tty1.service
sudo usermod -a -G tty $username
sudo usermod -a -G video $username