2024-09-16 02:11:48 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
. ../common-script.sh
|
|
|
|
|
2024-09-17 03:10:02 +01:00
|
|
|
installFastfetch() {
|
2024-09-16 02:11:48 +01:00
|
|
|
if ! command_exists fastfetch; then
|
2024-09-20 15:27:31 +01:00
|
|
|
printf "%b\n" "${YELLOW}Installing Fastfetch...${RC}"
|
2024-09-17 13:23:23 +01:00
|
|
|
case "$PACKAGER" in
|
2024-09-16 02:11:48 +01:00
|
|
|
pacman)
|
2024-09-19 01:03:32 +01:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm fastfetch
|
2024-09-16 02:11:48 +01:00
|
|
|
;;
|
2024-09-21 15:18:54 +01:00
|
|
|
apt-get|nala)
|
|
|
|
curl -sSLo /tmp/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-amd64.deb
|
|
|
|
"$ESCALATION_TOOL" dpkg -i /tmp/fastfetch.deb
|
|
|
|
rm /tmp/fastfetch.deb
|
|
|
|
;;
|
2024-09-16 02:11:48 +01:00
|
|
|
*)
|
2024-09-19 01:03:32 +01:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch
|
2024-09-16 02:11:48 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
else
|
2024-09-17 03:44:20 +01:00
|
|
|
printf "%b\n" "${GREEN}Fastfetch is already installed.${RC}"
|
2024-09-16 02:11:48 +01:00
|
|
|
fi
|
2024-09-16 03:32:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
setupFastfetchConfig() {
|
2024-09-17 03:44:20 +01:00
|
|
|
printf "%b\n" "${YELLOW}Copying Fastfetch config files...${RC}"
|
2024-09-16 02:11:48 +01:00
|
|
|
if [ -d "${HOME}/.config/fastfetch" ] && [ ! -d "${HOME}/.config/fastfetch-bak" ]; then
|
|
|
|
cp -r "${HOME}/.config/fastfetch" "${HOME}/.config/fastfetch-bak"
|
|
|
|
fi
|
|
|
|
mkdir -p "${HOME}/.config/fastfetch/"
|
|
|
|
curl -sSLo "${HOME}/.config/fastfetch/config.jsonc" https://raw.githubusercontent.com/ChrisTitusTech/mybash/main/config.jsonc
|
|
|
|
}
|
|
|
|
|
|
|
|
checkEnv
|
|
|
|
checkEscalationTool
|
2024-09-17 03:10:02 +01:00
|
|
|
installFastfetch
|
2024-09-16 03:32:57 +01:00
|
|
|
setupFastfetchConfig
|