forked from ChrisTitusTech/mybash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fastfetch.sh
executable file
·43 lines (34 loc) · 1.15 KB
/
fastfetch.sh
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
#!/bin/sh -e
# Define color variables
RC='\033[0m' # Reset
RED='\033[31m' # Red
GREEN='\033[32m' # Green
YELLOW='\033[33m' # Yellow
# 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
printf "${YELLOW}Cloning fastfetch repository into: $INSTALL_DIR${RC}\n"
if git clone "$FASTFETCH_REPO_URL" "$INSTALL_DIR"; then
printf "${GREEN}Successfully cloned fastfetch repository${RC}\n"
else
printf "${RED}Failed to clone fastfetch repository${RC}\n"
exit 1
fi
else
printf "${GREEN}Repository already exists at: $INSTALL_DIR${RC}\n"
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
printf "${GREEN}fastfetch has been successfully installed${RC}\n"