-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwaterfox-appimage.sh
More file actions
79 lines (67 loc) · 2.22 KB
/
waterfox-appimage.sh
File metadata and controls
79 lines (67 loc) · 2.22 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
#!/bin/sh
set -ex
export ARCH=$(uname -m)
APPIMAGETOOL="https://github.com/pkgforge-dev/appimagetool-uruntime/releases/download/continuous/appimagetool-$ARCH.AppImage"
UPINFO="gh-releases-zsync|$(echo $GITHUB_REPOSITORY | tr '/' '|')|latest|*$ARCH.AppImage.zsync"
export URUNTIME_PRELOAD=1 # really needed here
tarball_url="$(wget https://www.waterfox.com/download/ -O - | sed 's/[()",{} ]/\n/g' | grep -o "https.*Linux.*${ARCH}.*bz2")"
wget "$tarball_url" -O ./package.tar.bz2
tar xvf ./package.tar.bz2
rm -f ./package.tar.bz2
export VERSION=$(awk -F'=' '/Version/ {print $2; exit}' ./waterfox/application.ini)
echo "$VERSION" > ~/version
mv -v ./waterfox ./AppDir && (
cd ./AppDir
cp -v ./browser/chrome/icons/default/default128.png ./waterfox.png
cp -v ./browser/chrome/icons/default/default128.png ./.DirIcon
cat > ./AppRun <<- 'KEK'
#!/bin/sh
CURRENTDIR="$(cd "${0%/*}" && echo "$PWD")"
export PATH="${CURRENTDIR}:${PATH}"
export MOZ_LEGACY_PROFILES=1 # Prevent per installation profiles
export MOZ_APP_LAUNCHER="${APPIMAGE}" # Allows setting as default browser
exec "${CURRENTDIR}/waterfox" "$@"
KEK
chmod +x ./AppRun
# disable automatic updates
mkdir -p ./distribution
cat >> ./distribution/policies.json <<- 'KEK'
{
"policies": {
"DisableAppUpdate": true,
"AppAutoUpdate": false,
"BackgroundAppUpdate": false
}
}
KEK
cat > ./waterfox.desktop <<- 'KEK'
# add desktop[ file
[Desktop Entry]
Name=Waterfox
GenericName=Web Browser
Comment=Browse the World Wide Web
Keywords=Internet;WWW;Browser;Web;Explorer
Exec=waterfox %u
Icon=waterfox
Terminal=false
X-MultipleArgs=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;
StartupNotify=true
StartupWMClass=waterfox
Categories=Network;WebBrowser;
Actions=new-window;new-private-window;safe-mode;
[Desktop Action new-window]
Name=New Window
Exec=waterfox --new-window %u
[Desktop Action new-private-window]
Name=New Private Window
Exec=waterfox --private-window %u
[Desktop Action safe-mode]
Name=Safe Mode
Exec=waterfox -safe-mode %u
KEK
)
wget "$APPIMAGETOOL" -O ./appimagetool
chmod +x ./appimagetool
./appimagetool -n -u "$UPINFO" ./AppDir