From c9c83732d9a2e89411119c59fc57e5f7a46df825 Mon Sep 17 00:00:00 2001 From: Mayur Raut <95993675+RazoBeckett@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:20:48 +0530 Subject: [PATCH 1/3] fix: replace [[ ]] with [ ] for POSIX compatibility --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index d5f8d91..d36da4f 100755 --- a/setup.sh +++ b/setup.sh @@ -131,7 +131,7 @@ installDepend() { ${SUDO_CMD} ${PACKAGER} -v ${DEPENDENCIES} elif [ "$PACKAGER" = "nix-env" ]; then ${SUDO_CMD} ${PACKAGER} -iA nixos.bash nixos.bash-completion nixos.gnutar nixos.neovim nixos.bat nixos.tree nixos.multitail nixos.fastfetch nixos.pkgs.starship - elif [[ "$PACKAGER" == "dnf" ]]; then + elif [ "$PACKAGER" = "dnf" ]; then ${SUDO_CMD} ${PACKAGER} install -y ${DEPENDENCIES} else ${SUDO_CMD} ${PACKAGER} install -yq ${DEPENDENCIES} From 38c3bc06f5bca98ad60f1afc091b9cdf7d7766a2 Mon Sep 17 00:00:00 2001 From: Mayur Raut <95993675+RazoBeckett@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:14:57 +0530 Subject: [PATCH 2/3] refactor: change the default font and check accessiblility of link change font FiraCode -> Meslo .. and add check if the link can be accessed or not this will stop breaking the script --- setup.sh | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/setup.sh b/setup.sh index d36da4f..7553ce0 100755 --- a/setup.sh +++ b/setup.sh @@ -137,24 +137,30 @@ installDepend() { ${SUDO_CMD} ${PACKAGER} install -yq ${DEPENDENCIES} fi - # Check to see if the FiraCode Nerd Font is installed (Change this to whatever font you would like) - FONT_NAME="FiraCode Nerd Font" + # Check to see if the MesloLGS Nerd Font is installed (Change this to whatever font you would like) + FONT_NAME="MesloLGS Nerd Font Mono" 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_URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.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." + # check if the file is accessible + if wget -q --spider "$FONT_URL"; then + TEMP_DIR=$(mktemp -d) + wget $FONT_URL -O "$TEMP_DIR"/"${FONT_NAME}".zip + unzip "$TEMP_DIR"/"${FONT_NAME}".zip -d "$TEMP_DIR" + mkdir -p "$FONT_DIR"/"$FONT_NAME" + mv "${TEMP_DIR}"/*.ttf "$FONT_DIR"/"$FONT_NAME" + # Update the font cache + fc-cache -fv + # delete the files created from this + rm -rf "${TEMP_DIR}" + echo "'$FONT_NAME' installed successfully." + else + echo "Font '$FONT_NAME' not installed. Font URL is not accessible." + fi fi } From 426d1431e50fe20eba790932dad968bbf2114783 Mon Sep 17 00:00:00 2001 From: Mayur Raut <95993675+RazoBeckett@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:32:35 +0530 Subject: [PATCH 3/3] feat: only progress bar display only progress while downloading. --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 7553ce0..bc0f7be 100755 --- a/setup.sh +++ b/setup.sh @@ -149,7 +149,7 @@ installDepend() { # check if the file is accessible if wget -q --spider "$FONT_URL"; then TEMP_DIR=$(mktemp -d) - wget $FONT_URL -O "$TEMP_DIR"/"${FONT_NAME}".zip + wget -q --show-progress $FONT_URL -O "$TEMP_DIR"/"${FONT_NAME}".zip unzip "$TEMP_DIR"/"${FONT_NAME}".zip -d "$TEMP_DIR" mkdir -p "$FONT_DIR"/"$FONT_NAME" mv "${TEMP_DIR}"/*.ttf "$FONT_DIR"/"$FONT_NAME"