Skip to content

Commit 6fa3826

Browse files
authored
Add files via upload
1 parent 96ff3de commit 6fa3826

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

fastfetch-appimage.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
ARCH=$(uname -m)
6+
REPO="https://api.github.com/repos/fastfetch-cli/fastfetch/releases/latest"
7+
APPIMAGETOOL="https://github.com/pkgforge-dev/appimagetool-uruntime/releases/download/continuous/appimagetool-$ARCH.AppImage"
8+
UPINFO="gh-releases-zsync|$(echo $GITHUB_REPOSITORY | tr '/' '|')|latest|*$ARCH.AppImage.zsync"
9+
export URUNTIME_PRELOAD=1 # really needed here
10+
11+
# fastfetch uses amd64 instead of x86_64
12+
if [ "$(uname -m)" = 'x86_64' ]; then
13+
ARCH=amd64
14+
fi
15+
16+
tarball_url=$(wget "$REPO" -O - | sed 's/[()",{} ]/\n/g' \
17+
| grep -oi "https.*linux-$ARCH.tar.gz$" | head -1)
18+
19+
export ARCH=$(uname -m)
20+
export VERSION=$(echo "$tarball_url" | awk -F'/' '{print $(NF-1); exit}')
21+
echo "$VERSION" > ~/version
22+
23+
wget "$tarball_url" -O ./package.tar.gz
24+
tar xvf ./package.tar.gz
25+
rm -f ./package.tar.gz
26+
mv -v ./fastfetch-linux-* ./AppDir
27+
28+
echo '#!/bin/sh
29+
CURRENTDIR="$(readlink -f "$(dirname "$0")")"
30+
export PATH="$CURRENTDIR/usr/bin:$PATH"
31+
ARGV0="${ARGV0:-$0}"
32+
33+
if [ "${ARGV0#./}" = "flashfetch" ]; then
34+
exec "$CURRENTDIR"/usr/bin/flashfetch "$@"
35+
else
36+
exec "$CURRENTDIR"/usr/bin/fastfetch "$@"
37+
fi' > ./AppDir/AppRun
38+
chmod +x ./AppDir/AppRun
39+
40+
echo '[Desktop Entry]
41+
Type=Application
42+
Name=fastfetch
43+
Icon=fastfetch
44+
Exec=fastfetch
45+
Categories=System
46+
Hidden=true' > ./AppDir/fastfetch.desktop
47+
touch ./AppDir/fastfetch.png ./AppDir/.DirIcon
48+
49+
50+
wget "$APPIMAGETOOL" -O ./appimagetool
51+
chmod +x ./appimagetool
52+
./appimagetool -n -u "$UPINFO" ./AppDir
53+
54+

0 commit comments

Comments
 (0)