From 96e00431201668c9c454923f2a2e9476d3b44f55 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Wed, 26 Apr 2023 18:10:27 +1200 Subject: [PATCH] Optimise install.sh and install AUR package if on Arch --- install.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 5ed769b..99f8439 100644 --- a/install.sh +++ b/install.sh @@ -1,7 +1,13 @@ -dir=$(pwd) -cd /usr/local/bin/ -sudo curl -s https://raw.githubusercontent.com/jobcmax/maxfetch/main/maxfetch --output maxfetch -sudo chmod +x /usr/local/bin/maxfetch -echo "\033[1;34;48mmaxfetch is installed! \033[1;37;0m" +if [ -e /usr/bin/makepkg ]; then + printf "using AUR package\n" + pushd $(mktemp -d) + curl -s 'https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=maxfetch' -o PKGBUILD + makepkg -sci +else + pushd /usr/local/bin + sudo curl -s https://raw.githubusercontent.com/jobcmax/maxfetch/main/maxfetch -o maxfetch + sudo chmod +x maxfetch +fi +popd +printf "\033[1;34;48mmaxfetch is installed! \033[1;37;0m\n" maxfetch -cd $dir