-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfastfetch-appimage.sh
More file actions
63 lines (50 loc) · 1.69 KB
/
fastfetch-appimage.sh
File metadata and controls
63 lines (50 loc) · 1.69 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
#!/bin/sh
set -ex
ARCH=$(uname -m)
REPO="https://api.github.com/repos/fastfetch-cli/fastfetch/releases/latest"
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
# fastfetch uses amd64 instead of x86_64
if [ "$(uname -m)" = 'x86_64' ]; then
ARCH=amd64
glibcver=2.17
else
glibcver=2.28
fi
tarball_url=$(wget "$REPO" -O - | sed 's/[()",{} ]/\n/g' \
| grep -oi "https.*linux-$ARCH.tar.gz$" | head -1)
export ARCH=$(uname -m)
export VERSION=$(echo "$tarball_url" | awk -F'/' '{print $(NF-1); exit}')
echo "$VERSION" > ~/version
wget "$tarball_url" -O ./package.tar.gz
tar xvf ./package.tar.gz
rm -f ./package.tar.gz
mv -v ./fastfetch-linux-* ./AppDir
echo '#!/bin/sh
CURRENTDIR="$(readlink -f "$(dirname "$0")")"
export PATH="$CURRENTDIR/usr/bin:$PATH"
ARGV0="${ARGV0:-$0}"
if [ "${ARGV0#./}" = "flashfetch" ]; then
exec "$CURRENTDIR"/usr/bin/flashfetch "$@"
else
exec "$CURRENTDIR"/usr/bin/fastfetch "$@"
fi' > ./AppDir/AppRun
chmod +x ./AppDir/AppRun
echo '[Desktop Entry]
Type=Application
Name=fastfetch
Icon=fastfetch
Exec=fastfetch
Categories=System
Hidden=true' > ./AppDir/fastfetch.desktop
touch ./AppDir/fastfetch.png ./AppDir/.DirIcon
# get polyfil glibc so that fastfetch can work on older distros
git clone https://github.com/corsix/polyfill-glibc.git && (
cd ./polyfill-glibc
ninja polyfill-glibc
)
./polyfill-glibc/polyfill-glibc --target-glibc="$glibcver" ./AppDir/usr/bin/*
wget "$APPIMAGETOOL" -O ./appimagetool
chmod +x ./appimagetool
./appimagetool -n -u "$UPINFO" ./AppDir