forked from Botspot/pi-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·36 lines (26 loc) · 1.07 KB
/
install
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
#!/bin/bash
function error {
echo -e "\e[91m$1\e[39m"
exit 1
}
DIRECTORY="$(readlink -f "$(dirname "$0")")"
if [ -z "$(dpkg-query -W --showformat='${Status}\n' yad 2>/dev/null | grep "install ok installed")" ];then
zenity --title='Pi-Apps' --window-icon="${DIRECTORY}/icons/logo.png" \
--list --text="YAD is required but not installed. \n Install now?" \
--ok-label=Yes --cancel-label=No \
--column=foo --hide-header 2>/dev/null || error "User declined."
lxterminal --title="Installing YAD" -e "sudo apt install -y yad;echo -e '\nClosing in 5 seconds.';sleep 5"
fi
echo "Creating menu button..."
echo -n '' > ${HOME}/.local/share/applications/pi-apps.desktop
echo "[Desktop Entry]
Name=Pi Apps
Comment=Raspberry Pi App Store for open source projects
Exec=${DIRECTORY}/gui
Icon=${DIRECTORY}/icons/logo.png
Terminal=false
Type=Application
Categories=Utility;" >> ${HOME}/.local/share/applications/pi-apps.desktop
echo "Adding Desktop shortcut..."
cp -f ${HOME}/.local/share/applications/pi-apps.desktop ${HOME}/Desktop/pi-apps.desktop
echo "Installation complete."