-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·74 lines (59 loc) · 2.33 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/bash
if [ "$EUID" -eq 0 ]
then echo "Please do not run as root"
exit
fi
APP=StreamingServiceLauncher
RELEASE_URL=https://api.github.com/repos/aarron-lee/$APP/releases/latest
APPIMAGE_PATH=$HOME/Applications/$APP.AppImage
LAUNCHER_PATH=$HOME/.local/bin/streaming-service-launcher
STEAMOS_HELPER_PATH=$HOME/.local/bin/steamos-install-streaming-app
DESKTOP_ENTRY_HELPER_PATH=$HOME/.local/bin/create-streaming-app-desktop-entry
DESKTOP_ENTRY_PATH=$HOME/.local/share/applications/streamingservicelauncher.desktop
# make dirs if non-existent
mkdir -p $HOME/.local/bin
mkdir -p $HOME/Applications
# remove old versions
rm -f $HOME/.local/bin/StreamingServiceLauncher.AppImage
rm -f $APPIMAGE_PATH
rm -f $LAUNCHER_PATH
rm -f $DESKTOP_ENTRY_PATH
rm -f $STEAMOS_HELPER_PATH
rm -f $DESKTOP_ENTRY_HELPER_PATH
echo "Downloading $APP AppImage"
# curl -L $(curl -s $RELEASE_URL | grep "browser_download_url" | cut -d '"' -f 4) -o $HOME/.local/bin/$APP.AppImage
wget \
$(curl -s $RELEASE_URL | \
jq -r ".assets[] | select(.name | test(\".*AppImage\")) | .browser_download_url") \
-O $APPIMAGE_PATH
cat << EOF > $LAUNCHER_PATH
#!/bin/bash
$APPIMAGE_PATH --appname=\$1 --no-sandbox
EOF
cat << EOF > $DESKTOP_ENTRY_PATH
[Desktop Entry]
Name=StreamingServiceLauncher
Exec=$APPIMAGE_PATH --no-sandbox %U
TryExec=$APPIMAGE_PATH
Terminal=false
Type=Application
StartupWMClass=StreamingServiceLauncher
Comment=Simple Launcher for streaming services
Categories=Utility;
EOF
curl -L https://raw.githubusercontent.com/aarron-lee/StreamingServiceLauncher/refs/heads/main/scripts/steamos-install-streaming-app.sh > $STEAMOS_HELPER_PATH
curl -L https://raw.githubusercontent.com/aarron-lee/StreamingServiceLauncher/refs/heads/main/scripts/create-streaming-app-desktop-entry.sh > $DESKTOP_ENTRY_HELPER_PATH
chmod +x $APPIMAGE_PATH
chmod +x $LAUNCHER_PATH
chmod +x $STEAMOS_HELPER_PATH
chmod +x $DESKTOP_ENTRY_HELPER_PATH
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
if [ -f "$IMAGE_INFO" ]; then
echo "Ublue image detected"
# handle for SE Linux
sudo chcon -u system_u -r object_r --type=bin_t $APPIMAGE_PATH
sudo chcon -u system_u -r object_r --type=bin_t $LAUNCHER_PATH
sudo chcon -u system_u -r object_r --type=bin_t $STEAMOS_HELPER_PATH
sudo chcon -u system_u -r object_r --type=bin_t $DESKTOP_ENTRY_HELPER_PATH
fi
echo "Installation complete"