forked from UnchartedBull/OctoDash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·56 lines (43 loc) · 1.72 KB
/
install.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
release=$(curl -s "https://api.github.com/repos/UnchartedBull/OctoDash/releases/latest" | grep "browser_download_url.*armv7l.deb" | cut -d '"' -f 4)
dependencies="libgtk-3-0 libnotify4 libnss3 libxss1 libxtst6 xdg-utils libatspi2.0-0 libuuid1 libappindicator3-1 libsecret-1-0 gir1.2-gnomekeyring-1.0"
if [ -d "/home/pi/OctoPrint/venv" ]; then
DIRECTORY="/home/pi/OctoPrint/venv"
elif [ -d "/home/pi/oprint" ]; then
DIRECTORY="/home/pi/oprint"
else
echo "Neither /home/pi/OctoPrint/venv nor /home/pi/oprint can be found. Please specify OctoPrints full virtualenv path manually (no trailing slash):"
read -r DIRECTORY
fi;
"$DIRECTORY"/bin/pip install -q "https://github.com/OllisGit/OctoPrint-DisplayLayerProgress/releases/latest/download/master.zip"
"$DIRECTORY"/bin/pip install -q "https://github.com/vitormhenrique/OctoPrint-Enclosure/archive/master.zip"
"$DIRECTORY"/bin/pip install -q "https://github.com/marian42/octoprint-preheat/archive/master.zip"
if [[ $* == *--ptg* ]]; then
"$DIRECTORY"/bin/pip install -q "https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/master.zip"
fi
echo "Installing Dependencies"
sudo apt -qq update
sudo apt -qq install $dependencies -y
echo "Installing OctoDash"
cd ~
wget -O octodash.deb $release -q --show-progress
sudo dpkg -i octodash.deb
rm octodash.deb
echo "Setting up Autostart"
cat <<EOF > ~/.xinitrc
#!/bin/sh
xset s off
xset s noblank
xset -dpms
ratpoison&
octodash
EOF
cat <<EOF >> ~/.bashrc
if [ -z "\$SSH_CLIENT" ] || [ -z "\$SSH_TTY" ]; then
xinit -- -nocursor
fi
EOF
echo "Setting Permission"
sudo chmod +x ~/.xinitrc
sudo chmod ug+s /usr/lib/xorg/Xorg
echo "Done. OctoDash will start automatically on next reboot. Please ensure that auto-login is enabled."