-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtop-appimage.sh
More file actions
48 lines (37 loc) · 1.24 KB
/
htop-appimage.sh
File metadata and controls
48 lines (37 loc) · 1.24 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
#!/bin/sh
set -eux
export ARCH="$(uname -m)"
export APPIMAGE_EXTRACT_AND_RUN=1
APP=htop
APPDIR="$APP".AppDir
UPINFO="gh-releases-zsync|$(echo $GITHUB_REPOSITORY | tr '/' '|')|continuous|*$ARCH.AppImage.zsync"
APPIMAGETOOL="https://github.com/pkgforge-dev/appimagetool-uruntime/releases/download/continuous/appimagetool-$ARCH.AppImage"
# CREATE DIRECTORIES
mkdir -p ./AppDir
cd ./AppDir
# DOWNLOAD AND BUILD HTOP
HTOP_URL=$(wget -q https://api.github.com/repos/htop-dev/htop/releases -O - \
| sed 's/[()",{} ]/\n/g' | grep -oi 'https.*releases.*htop.*tar.xz' | head -1)
wget "$HTOP_URL" -O ./htop.tar.xz
tar fx ./htop.tar.xz && (
cd ./htop*
./autogen.sh
./configure --prefix="$(readlink -f ../)" --enable-sensors --enable-static
make
make install
)
rm -rf ./htop* ./*.tar.*
# PREPARE APPIMAGE
cp -v ./share/applications/htop.desktop ./
cp -v ./share/pixmaps/htop.png ./
cp -v ./share/pixmaps/htop.png ./.DirIcon
ln -s ./bin/htop ./AppRun
chmod +x ./bin/htop
VERSION="$(./AppRun -V | awk '{print $2; exit}')"
echo "$VERSION" > ~/version
# MAKE APPIMAGE
cd ..
wget "$APPIMAGETOOL" -O ./appimagetool
chmod +x ./appimagetool
./appimagetool -n -u "$UPINFO" "$PWD"/AppDir "$PWD"/"$APP"-"$VERSION"-anylinux-"$ARCH".AppImage
echo "All Done!"