-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathscript.sh
68 lines (52 loc) · 1.95 KB
/
script.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
#!/usr/bin/env bash
name=$1
dirname=$2
favicon=$3
mkdir -p ~/appnativefy && cd ~/appnativefy && mkdir -p .appimage-temp
cd .appimage-temp
(
cd "$name".AppDir/
mkdir -p ~/appnativefy/.appimage-temp/"$name".AppDir/resources/app/inject
cp $2/style.css ~/appnaivefy/.appimage-temp/"$name".AppDir/resources/app/inject/style.css
iconname="icon.png"
echo
anotherfile=/usr/local/lib/node_modules/appnativefy/icon.png
FILE=resources/app/icon.png
b="true"
if [ "$favicon" = "$b" ]; then
favicon="https://www.google.com/s2/favicons?sz=64&domain_url="
faviconlink=$favicon$4
wget $faviconlink -O resources/app/icon.png
fi
if [ -f "$FILE" ]; then
echo "$FILE exists."
else
if -f "$anotherfile" ]; then
cp /usr/local/lib/node_modules/appnativefy/icon.png resources/app/icon.png
else
wget -c "https://raw.githubusercontent.com/sarweshparajuli/appnativefy/main/icon.png" -O resources/app/icon.png
fi
fi
cp $dirname/style.css resources/app/inject/inject.css
cp resources/app/icon.png icon.png
echo "[Desktop Entry]" > $name.desktop
echo "Name=$name" >> $name.desktop
echo "Exec=AppRun %U" >> $name.desktop
echo "Terminal=false" >> $name.desktop
echo "Type=Application" >> $name.desktop
echo "Icon=${iconname%.*}" >> $name.desktop
echo "X-AppImage-Version=1.0.0" >> $name.desktop
echo "Categories=Network;WebBrowser;" >> $name.desktop
echo "#!/bin/bash" > AppRun
echo "exec \$APPDIR/$name" >> AppRun
chmod +x ./AppRun
)
mkdir -p ~/appnativefy/.appimagetool
[ ! -e ~/appnativefy/.appimagetool/appimagetool ] && wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O ~/appnativefy/.appimagetool/appimagetool
chmod +x ~/appnativefy/.appimagetool/appimagetool
~/appnativefy/.appimagetool/appimagetool "$name.AppDir"
cp *.AppImage ../
cd ..
rm -r ~/appnativefy/.appimage-temp
rm -r ~/appnativefy/.script.sh
rm -rf ~/appnativefy/icon.png