Skip to content

Commit

Permalink
fix setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTitusTech committed Jul 14, 2024
1 parent 51feaae commit cf34e69
Showing 1 changed file with 33 additions and 23 deletions.
56 changes: 33 additions & 23 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,29 +99,10 @@ checkEnv() {

installDepend() {
## Check for dependencies.
DEPENDENCIES='bash bash-completion tar bat tree multitail fastfetch'
DEPENDENCIES='bash bash-completion tar bat tree multitail fastfetch wget unzip'
if ! command_exists nvim; then
DEPENDENCIES="${DEPENDENCIES} neovim"
fi
# Check to see if a the FiraCode Nerd Font is installed (Change this to whatever font you would like)
FONT_NAME="FiraCode Nerd Font"
if fc-list :family | grep -iq "$FONT_NAME"; then
echo "Font '$FONT_NAME' is installed."
else
echo "Installing font '$FONT_NAME'"
# Change this URL to correspond with the correct font
FONT_URL="https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/FiraCode.zip"
FONT_DIR="$HOME/.local/share/fonts"
wget $FONT_URL -O ${FONT_NAME}.zip
unzip ${FONT_NAME}.zip -d $FONT_NAME
mkdir -p $FONT_DIR
mv ${FONT_NAME}/*.ttf $FONT_DIR/
# Update the font cache
fc-cache -fv
# delete the files created from this
rm -rf ${FONT_NAME} ${FONT_NAME}.zip
echo "'$FONT_NAME' installed successfully."
fi

echo "${YELLOW}Installing dependencies...${RC}"
if [ "$PACKAGER" = "pacman" ]; then
Expand Down Expand Up @@ -155,6 +136,26 @@ installDepend() {
else
${SUDO_CMD} ${PACKAGER} install -yq ${DEPENDENCIES}
fi

# Check to see if a the FiraCode Nerd Font is installed (Change this to whatever font you would like)
FONT_NAME="FiraCode Nerd Font"
if fc-list :family | grep -iq "$FONT_NAME"; then
echo "Font '$FONT_NAME' is installed."
else
echo "Installing font '$FONT_NAME'"
# Change this URL to correspond with the correct font
FONT_URL="https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/FiraCode.zip"
FONT_DIR="$HOME/.local/share/fonts"
wget $FONT_URL -O ${FONT_NAME}.zip
unzip ${FONT_NAME}.zip -d $FONT_NAME
mkdir -p $FONT_DIR
mv ${FONT_NAME}/*.ttf $FONT_DIR/
# Update the font cache
fc-cache -fv
# delete the files created from this
rm -rf ${FONT_NAME} ${FONT_NAME}.zip
echo "'$FONT_NAME' installed successfully."
fi
}

installStarshipAndFzf() {
Expand Down Expand Up @@ -232,7 +233,10 @@ create_fastfetch_config() {
if [ -e "$USER_HOME/.config/fastfetch/config.jsonc" ]; then
rm -f "$USER_HOME/.config/fastfetch/config.jsonc"
fi
ln -svf "$GITPATH/config.jsonc" "$USER_HOME/.config/fastfetch/config.jsonc"
ln -svf "$GITPATH/config.jsonc" "$USER_HOME/.config/fastfetch/config.jsonc" || {
echo "${RED}Failed to create symbolic link for fastfetch config${RC}"
exit 1
}
}

linkConfig() {
Expand All @@ -249,8 +253,14 @@ linkConfig() {
fi

echo "${YELLOW}Linking new bash config file...${RC}"
ln -svf "$GITPATH/.bashrc" "$USER_HOME/.bashrc"
ln -svf "$GITPATH/starship.toml" "$USER_HOME/.config/starship.toml"
ln -svf "$GITPATH/.bashrc" "$USER_HOME/.bashrc" || {
echo "${RED}Failed to create symbolic link for .bashrc${RC}"
exit 1
}
ln -svf "$GITPATH/starship.toml" "$USER_HOME/.config/starship.toml" || {
echo "${RED}Failed to create symbolic link for starship.toml${RC}"
exit 1
}
}

checkEnv
Expand Down

0 comments on commit cf34e69

Please sign in to comment.