linutil/core/tabs/applications-setup/fastfetch-setup.sh
Jeevitha Kannan K S 1e39d967c5
feat: Alpine linux support (#814)
* Add basic apk to scripts

* Add common service script

* Fix alpine bugs

* Add flatpak installations

* chore: update scripts, add common-service-script to shellcheckrc
2024-11-07 13:03:21 -06:00

41 lines
1.4 KiB
Bash

#!/bin/sh -e
. ../common-script.sh
installFastfetch() {
if ! command_exists fastfetch; then
printf "%b\n" "${YELLOW}Installing Fastfetch...${RC}"
case "$PACKAGER" in
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm fastfetch
;;
apt-get|nala)
curl -sSLo /tmp/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-amd64.deb
"$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb
rm /tmp/fastfetch.deb
;;
apk)
"$ESCALATION_TOOL" "$PACKAGER" add fastfetch
;;
*)
"$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch
;;
esac
else
printf "%b\n" "${GREEN}Fastfetch is already installed.${RC}"
fi
}
setupFastfetchConfig() {
printf "%b\n" "${YELLOW}Copying Fastfetch config files...${RC}"
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
installFastfetch
setupFastfetchConfig