From db37eae31b59f4eefc6a4fdaa3ddd57f4e1960e4 Mon Sep 17 00:00:00 2001 From: dhruvmistry2000 Date: Thu, 19 Sep 2024 15:01:50 +0530 Subject: [PATCH] Create fastfetch.sh --- fastfetch.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 fastfetch.sh diff --git a/fastfetch.sh b/fastfetch.sh new file mode 100644 index 0000000..17e5db2 --- /dev/null +++ b/fastfetch.sh @@ -0,0 +1,38 @@ +#!/bin/sh -e + +# Define variables for the repository URL and the installation directory +FASTFETCH_REPO_URL="https://github.com/LinusDierheimer/fastfetch" +INSTALL_DIR="$HOME/fastfetch" + +# Check if the installation directory exists, create it if it doesn't +if [ ! -d "$INSTALL_DIR" ]; then + echo "Cloning fastfetch repository into: $INSTALL_DIR" + git clone "$FASTFETCH_REPO_URL" "$INSTALL_DIR" + if [ $? -eq 0 ]; then + echo "Successfully cloned fastfetch repository" + else + echo "Failed to clone fastfetch repository" + exit 1 + fi +else + echo "Repository already exists at: $INSTALL_DIR" +fi + +# Navigate to the installation directory +cd "$INSTALL_DIR" + +# Pull the latest changes from the repository +git pull + +# Create a build directory and navigate into it +mkdir -p build +cd build + +# Run cmake and make to compile fastfetch +cmake .. +make -j$(nproc) + +# Install fastfetch +sudo make install + +echo "fastfetch has been successfully installed"