@@ -131,30 +131,36 @@ installDepend() {
131
131
${SUDO_CMD} ${PACKAGER} -v ${DEPENDENCIES}
132
132
elif [ " $PACKAGER " = " nix-env" ]; then
133
133
${SUDO_CMD} ${PACKAGER} -iA nixos.bash nixos.bash-completion nixos.gnutar nixos.neovim nixos.bat nixos.tree nixos.multitail nixos.fastfetch nixos.pkgs.starship
134
- elif [[ " $PACKAGER " == " dnf" ] ]; then
134
+ elif [ " $PACKAGER " = " dnf" ]; then
135
135
${SUDO_CMD} ${PACKAGER} install -y ${DEPENDENCIES}
136
136
else
137
137
${SUDO_CMD} ${PACKAGER} install -yq ${DEPENDENCIES}
138
138
fi
139
139
140
- # Check to see if the FiraCode Nerd Font is installed (Change this to whatever font you would like)
141
- FONT_NAME=" FiraCode Nerd Font"
140
+ # Check to see if the MesloLGS Nerd Font is installed (Change this to whatever font you would like)
141
+ FONT_NAME=" MesloLGS Nerd Font Mono "
142
142
if fc-list :family | grep -iq " $FONT_NAME " ; then
143
143
echo " Font '$FONT_NAME ' is installed."
144
144
else
145
145
echo " Installing font '$FONT_NAME '"
146
146
# Change this URL to correspond with the correct font
147
- FONT_URL=" https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/FiraCode .zip"
147
+ FONT_URL=" https://github.com/ryanoasis/nerd-fonts/releases/latest/ download/Meslo .zip"
148
148
FONT_DIR=" $HOME /.local/share/fonts"
149
- wget $FONT_URL -O ${FONT_NAME} .zip
150
- unzip ${FONT_NAME} .zip -d $FONT_NAME
151
- mkdir -p $FONT_DIR
152
- mv ${FONT_NAME} /* .ttf $FONT_DIR /
153
- # Update the font cache
154
- fc-cache -fv
155
- # delete the files created from this
156
- rm -rf ${FONT_NAME} ${FONT_NAME} .zip
157
- echo " '$FONT_NAME ' installed successfully."
149
+ # check if the file is accessible
150
+ if wget -q --spider " $FONT_URL " ; then
151
+ TEMP_DIR=$( mktemp -d)
152
+ wget -q --show-progress $FONT_URL -O " $TEMP_DIR " /" ${FONT_NAME} " .zip
153
+ unzip " $TEMP_DIR " /" ${FONT_NAME} " .zip -d " $TEMP_DIR "
154
+ mkdir -p " $FONT_DIR " /" $FONT_NAME "
155
+ mv " ${TEMP_DIR} " /* .ttf " $FONT_DIR " /" $FONT_NAME "
156
+ # Update the font cache
157
+ fc-cache -fv
158
+ # delete the files created from this
159
+ rm -rf " ${TEMP_DIR} "
160
+ echo " '$FONT_NAME ' installed successfully."
161
+ else
162
+ echo " Font '$FONT_NAME ' not installed. Font URL is not accessible."
163
+ fi
158
164
fi
159
165
}
160
166
0 commit comments