Skip to content

Commit 77c4441

Browse files
Update fastfetch-setup.sh - fmt
1 parent d52af3f commit 77c4441

File tree

1 file changed

+64
-64
lines changed

1 file changed

+64
-64
lines changed

core/tabs/applications-setup/fastfetch-setup.sh

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -3,79 +3,79 @@
33
. ../common-script.sh
44

55
installFastfetch() {
6-
if ! command_exists fastfetch; then
7-
printf "%b\n" "${YELLOW}Installing Fastfetch...${RC}"
8-
case "$PACKAGER" in
9-
pacman)
10-
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm fastfetch
11-
;;
12-
apt-get | nala)
13-
curl -sSLo /tmp/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-amd64.deb
14-
"$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb
15-
rm /tmp/fastfetch.deb
16-
;;
17-
apk)
18-
"$ESCALATION_TOOL" "$PACKAGER" add fastfetch
19-
;;
20-
*)
21-
"$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch
22-
;;
23-
esac
24-
else
25-
printf "%b\n" "${GREEN}Fastfetch is already installed.${RC}"
26-
fi
6+
if ! command_exists fastfetch; then
7+
printf "%b\n" "${YELLOW}Installing Fastfetch...${RC}"
8+
case "$PACKAGER" in
9+
pacman)
10+
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm fastfetch
11+
;;
12+
apt-get | nala)
13+
curl -sSLo /tmp/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-amd64.deb
14+
"$ESCALATION_TOOL" "$PACKAGER" install -y /tmp/fastfetch.deb
15+
rm /tmp/fastfetch.deb
16+
;;
17+
apk)
18+
"$ESCALATION_TOOL" "$PACKAGER" add fastfetch
19+
;;
20+
*)
21+
"$ESCALATION_TOOL" "$PACKAGER" install -y fastfetch
22+
;;
23+
esac
24+
else
25+
printf "%b\n" "${GREEN}Fastfetch is already installed.${RC}"
26+
fi
2727
}
2828

2929
setupFastfetchConfig() {
30-
printf "%b\n" "${YELLOW}Copying Fastfetch config files...${RC}"
31-
if [ -d "${HOME}/.config/fastfetch" ] && [ ! -d "${HOME}/.config/fastfetch-bak" ]; then
32-
cp -r "${HOME}/.config/fastfetch" "${HOME}/.config/fastfetch-bak"
33-
fi
34-
mkdir -p "${HOME}/.config/fastfetch/"
35-
curl -sSLo "${HOME}/.config/fastfetch/config.jsonc" https://raw.githubusercontent.com/ChrisTitusTech/mybash/main/config.jsonc
30+
printf "%b\n" "${YELLOW}Copying Fastfetch config files...${RC}"
31+
if [ -d "${HOME}/.config/fastfetch" ] && [ ! -d "${HOME}/.config/fastfetch-bak" ]; then
32+
cp -r "${HOME}/.config/fastfetch" "${HOME}/.config/fastfetch-bak"
33+
fi
34+
mkdir -p "${HOME}/.config/fastfetch/"
35+
curl -sSLo "${HOME}/.config/fastfetch/config.jsonc" https://raw.githubusercontent.com/ChrisTitusTech/mybash/main/config.jsonc
3636
}
3737

3838
setupFastfetchShell() {
39-
printf "%b\n" "${YELLOW}Configuring shell integration...${RC}"
39+
printf "%b\n" "${YELLOW}Configuring shell integration...${RC}"
4040

41-
current_shell=$(basename "$SHELL")
42-
rc_file=""
41+
current_shell=$(basename "$SHELL")
42+
rc_file=""
4343

44-
case "$current_shell" in
45-
"bash")
46-
rc_file="$HOME/.bashrc"
47-
;;
48-
"zsh")
49-
rc_file="$HOME/.zshrc"
50-
;;
51-
"fish")
52-
rc_file="$HOME/.config/fish/config.fish"
53-
;;
54-
"nu")
55-
rc_file="$HOME/.config/nushell/config.nu"
56-
;;
57-
*)
58-
printf "%b\n" "${RED}$current_shell is not supported. Update your shell configuration manually.${RC}"
59-
;;
60-
esac
44+
case "$current_shell" in
45+
"bash")
46+
rc_file="$HOME/.bashrc"
47+
;;
48+
"zsh")
49+
rc_file="$HOME/.zshrc"
50+
;;
51+
"fish")
52+
rc_file="$HOME/.config/fish/config.fish"
53+
;;
54+
"nu")
55+
rc_file="$HOME/.config/nushell/config.nu"
56+
;;
57+
*)
58+
printf "%b\n" "${RED}$current_shell is not supported. Update your shell configuration manually.${RC}"
59+
;;
60+
esac
6161

62-
if [ ! -f "$rc_file" ]; then
63-
printf "%b\n" "${RED}Shell config file $rc_file not found${RC}"
64-
else
65-
if grep -q "fastfetch" "$rc_file"; then
66-
printf "%b\n" "${YELLOW}Fastfetch is already configured in $rc_file${RC}"
67-
return 0
68-
else
69-
printf "%b" "${GREEN}Would you like to add fastfetch to $rc_file? [y/N] ${RC}"
70-
read -r response
71-
if [ "$response" = "y" ] || [ "$response" = "Y" ]; then
72-
printf "\n# Run fastfetch on shell initialization\nfastfetch\n" >>"$rc_file"
73-
printf "%b\n" "${GREEN}Added fastfetch to $rc_file${RC}"
74-
else
75-
printf "%b\n" "${YELLOW}Skipped adding fastfetch to shell config${RC}"
76-
fi
77-
fi
78-
fi
62+
if [ ! -f "$rc_file" ]; then
63+
printf "%b\n" "${RED}Shell config file $rc_file not found${RC}"
64+
else
65+
if grep -q "fastfetch" "$rc_file"; then
66+
printf "%b\n" "${YELLOW}Fastfetch is already configured in $rc_file${RC}"
67+
return 0
68+
else
69+
printf "%b" "${GREEN}Would you like to add fastfetch to $rc_file? [y/N] ${RC}"
70+
read -r response
71+
if [ "$response" = "y" ] || [ "$response" = "Y" ]; then
72+
printf "\n# Run fastfetch on shell initialization\nfastfetch\n" >>"$rc_file"
73+
printf "%b\n" "${GREEN}Added fastfetch to $rc_file${RC}"
74+
else
75+
printf "%b\n" "${YELLOW}Skipped adding fastfetch to shell config${RC}"
76+
fi
77+
fi
78+
fi
7979

8080
}
8181

0 commit comments

Comments
 (0)