-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.sh
More file actions
88 lines (79 loc) · 2.73 KB
/
start.sh
File metadata and controls
88 lines (79 loc) · 2.73 KB
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/env bash
set -e
if ! command -v curl >/dev/null 2>&1 || ! command -v attr >/dev/null 2>&1; then
echo "curl and/or attr is required but not installed. Attempting to install..."
if sudo ./pacapt -S curl attr; then
echo "curl and attr installed successfully."
else
echo "Failed to install curl and attr using pacapt. Please install using your preffered package manager. Aborting."
exit 1
fi
fi
# Seperate to prevent possible fuse2 and fuse3 conflict error
if ! command -v fusermount >/dev/null 2>&1; then
echo "FUSE is required but not installed. Attempting to install..."
if sudo ./pacapt -S fuse; then
echo "FUSE installed successfully."
else
echo "Failed to install FUSE using pacapt. Please install using your preffered package manager. Aborting."
exit 1
fi
fi
nwjs_loc=~/.local/share/porter/nwjs/nw
cicpoffs_loc=~/.local/bin/cicpoffs
if [ -f ./nw ] && [ -f ./cicpoffs ]; then
echo "using nwjs and cicpoffs version found in the same directory!"
nwjs_loc=./nw
cicpoffs_loc=./cicpoffs
else
if [ -f ~/.local/share/porter/nwjs/nw ]; then
echo "nwjs found!"
else
echo "nwjs not found! Downloading version 0.84.0 (latest as of this script)..."
mkdir ~/.local/share/porter
curl https://dl.nwjs.io/v0.84.0/nwjs-sdk-v0.84.0-linux-x64.tar.gz -o ~/.local/share/porter/nwjs.tar.gz
tar -xzvf ~/.local/share/porter/nwjs.tar.gz -C ~/.local/share/porter/
mv ~/.local/share/porter/nwjs-sdk-v0.84.0-linux-x64 ~/.local/share/porter/nwjs
rm -f ~/.local/share/porter/nwjs.tar.gz
echo "0.84.0" > ~/.local/share/porter/nwjs/nwjs-version.txt
fi
if [ -f ~/.local/bin/cicpoffs ]; then
echo "cicpoffs found!"
else
if [ ! -d ~/.local/bin ]; then
mkdir ~/.local/bin
fi
echo "cicpoffs not found! Downloading..."
curl -L https://github.com/m5kro/cicpoffs/releases/download/binary/cicpoffs -o ~/.local/bin/cicpoffs
chmod +x ~/.local/bin/cicpoffs
fi
fi
if [ -d ./www ] && [ -f ./package.json ]; then
echo "www folder and package.json found!"
echo "checking for patch updates..."
./update-patch.sh
else
echo "www folder or package.json missing!"
exit
fi
echo "Moving to case insensitive..."
mv "www" "www-case"
mkdir "www"
"$cicpoffs_loc" "./www-case" "./www"
echo "Waiting for FUSE..."
sleep 3
if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then
echo "wayland detected"
"$nwjs_loc" . --ozone-platform=wayland
else
echo "wayland not detected, starting in x11"
"$nwjs_loc" . --ozone-platform=x11
fi
if [ -d ./www ]; then
echo "unmounting..."
fusermount -u "./www"
rm -rf www
mv "www-case" "www"
else
echo "www mount point missing!"
fi