forked from phoenixbyrd/App-Installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_armcord.sh
88 lines (75 loc) · 2.42 KB
/
install_armcord.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
#This script installs aarch64 .tar.xz or .tar.gz into debian proot /opt directory and creates a desktop and menu launcher
# Default values to edit
#Enter URL to appimage
url="https://github.com/ArmCord/ArmCord/releases/download/v3.2.7/ArmCord_3.2.7_arm64.deb"
#Enter name of app
appname="armcord"
#Enter path to icon or system icon name
#/data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/debian
icon_path="discord"
#Enter Categories for .desktop
category="Network"
#Enter any dependencies
depends="libasound2 pulseaudio-module-jack pulseaudio"
#Do not edit below here unless required
# Process command line arguments
while [[ $# -gt 0 ]]; do
case "$1" in
--install)
install=true
shift
;;
--uninstall)
uninstall=true
shift
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
if [ "$install" = true ]; then
download="wget $url"
install="prun sudo apt install -y "
varname=$(basename $HOME/../usr/var/lib/proot-distro/installed-rootfs/debian/home/*)
prun="proot-distro login debian --user $varname --shared-tmp -- env DISPLAY=:1.0 $@"
$prun $download
$install $depends
$install ./${url##*/}
$prun rm ${url##*/}
installed_dir="$HOME/../usr/var/lib/proot-distro/installed-rootfs/debian/$dir"
desktop_file="$HOME/Desktop/$appname.desktop"
binary=$(find "$installed_dir" -type f -executable -print -quit)
#If binary is different, specify it here after $installed_dir/ and use $alt_binary instead of $binary
alt_binary="$installed_dir/"
#If binary is sandboxed use $sandboxed at end of Exec command
sandboxed="--no-sandbox"
#NOTE: Do not remove prun from Exec command
cat > "$desktop_file" <<EOL
[Desktop Entry]
Version=1.0
Type=Application
Name=Discord
Comment=Discord
Exec=prun $appname $sandboxed
Icon=$icon_path
Categories=$category
Terminal=false
EOL
chmod +x "$desktop_file"
cp "$desktop_file" $HOME/../usr/share/applications
echo "Installation completed."
elif [ "$uninstall" = true ]; then
echo "Uninstalling..."
uninstall="prun sudo apt remove"
$uninstall $appname -y
desktop_file="$HOME/Desktop/$appname.desktop"
rm "$desktop_file"
rm "$HOME/../usr/share/applications/$appname.desktop"
echo "Uninstallation completed."
else
echo "No valid option provided. Use --install or --uninstall."
exit 1
fi