-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
update
executable file
·57 lines (47 loc) · 1.62 KB
/
update
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
57
#!/bin/bash
rm -f ${HOME}/logo-64.png
#get icon ahead of time so zenity can use it
wget https://raw.githubusercontent.com/Botspot/Pi-Power-Tools/master/icons/logo-64.png
trap "rm ${HOME}/logo-64.png" EXIT
(
echo 0
echo "# Downloading PPT to ${HOME}/Pi-Power-Tools..."
cd $HOME
rm -rf ${HOME}/Pi-Power-Tools.old
mv -f ${HOME}/Pi-Power-Tools ${HOME}/Pi-Power-Tools.old 2>/dev/null
git clone https://github.com/Botspot/Pi-Power-Tools || exit 1
#transfer old config
if [ -d "${HOME}/Pi-Power-Tools.old/" ]; then
cp ${HOME}/Pi-Power-Tools.old/data/imglist ${HOME}/Pi-Power-Tools/data/
cp ${HOME}/Pi-Power-Tools.old/data/ziplist ${HOME}/Pi-Power-Tools/data/
fi
sleep 3
echo 25
echo "# Downloading Vdesktop..."
cd ${HOME}/Pi-Power-Tools
git clone https://github.com/Botspot/vdesktop || exit 1
sleep 1
echo 50
echo "# Click Yes to install required packages."
${HOME}/Pi-Power-Tools/installgui "yad" || exit 0
echo 75
echo "# Creating menu button..."
echo -n '' > ${HOME}/.local/share/applications/ppt.desktop
echo "[Desktop Entry]
Name=Pi Power Tools
Comment=General Purpose Raspbian Image & SD Card Manager
Exec=${HOME}/Pi-Power-Tools/home menubutton
Icon=${HOME}/Pi-Power-Tools/icons/logo-64.png
Terminal=false
Type=Application
Categories=Utility;" >> ${HOME}/.local/share/applications/ppt.desktop
#also copy to desktop
cp ${HOME}/.local/share/applications/ppt.desktop ${HOME}/Desktop
sleep 5
echo 100
echo -e "# Finished! Pi Power Tools is located in Menu --> Accessories."
#sleep 5
) |
zenity --progress --title='PPT Installer' --window-icon="${HOME}/logo-64.png" \
--width=300 --ok-label=Close 2>/dev/null
#${HOME}/Pi-Power-Tools/pi-power-tools &