From a8ddf21d4e38b6a9d32d5881cd40f71cc33ef83e Mon Sep 17 00:00:00 2001 From: Da_Person Date: Wed, 2 Jul 2025 22:25:24 -0700 Subject: [PATCH] Fixes for install.sh file wrong names and update other files to conform with Shellcheck --- auto-install.sh | 4 ++-- install-scripts/01-hypr-pkgs.sh | 2 +- install-scripts/Global_functions.sh | 3 ++- install-scripts/gtk_themes.sh | 5 +++-- install-scripts/hyprcursor.sh | 4 ++-- install-scripts/hyprgraphics.sh | 4 ++-- install-scripts/hypridle.sh | 4 ++-- install-scripts/hyprland-protocols.sh | 2 +- install-scripts/hyprland-qt-support.sh | 4 ++-- install-scripts/hyprland-qtutils.sh | 4 ++-- install-scripts/hyprland.sh | 2 +- install-scripts/nvidia.sh | 2 +- install-scripts/sddm.sh | 2 ++ install.sh | 4 ++-- 14 files changed, 25 insertions(+), 21 deletions(-) diff --git a/auto-install.sh b/auto-install.sh index a75c0da..efb7610 100644 --- a/auto-install.sh +++ b/auto-install.sh @@ -37,14 +37,14 @@ printf "\n%.0s" {1..1} if [ -d "$Distro_DIR" ]; then echo "${YELLOW}$Distro_DIR exists. Updating the repository... ${RESET}" - cd "$Distro_DIR" + cd "$Distro_DIR" || exit 1 git stash && git pull chmod +x install.sh ./install.sh else echo "${MAGENTA}$Distro_DIR does not exist. Cloning the repository...${RESET}" git clone --depth=1 "$Github_URL" "$Distro_DIR" - cd "$Distro_DIR" + cd "$Distro_DIR" || exit 1 chmod +x install.sh ./install.sh fi \ No newline at end of file diff --git a/install-scripts/01-hypr-pkgs.sh b/install-scripts/01-hypr-pkgs.sh index d478807..115dac2 100755 --- a/install-scripts/01-hypr-pkgs.sh +++ b/install-scripts/01-hypr-pkgs.sh @@ -138,6 +138,6 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 2>&1 | t source "$HOME/.cargo/env" ## making brightnessctl work -sudo chmod +s $(which brightnessctl) 2>&1 | tee -a "$LOG" || true +sudo chmod +s "$(which brightnessctl)" 2>&1 | tee -a "$LOG" || true printf "\n%.0s" {1..2} diff --git a/install-scripts/Global_functions.sh b/install-scripts/Global_functions.sh index 365f74c..f522ad5 100755 --- a/install-scripts/Global_functions.sh +++ b/install-scripts/Global_functions.sh @@ -36,7 +36,7 @@ show_progress() { tput civis printf "\r${INFO} Installing ${YELLOW}%s${RESET} ..." "$package_name" - while ps -p $pid &> /dev/null; do + while ps -p "$pid" &> /dev/null; do printf "\r${INFO} Installing ${YELLOW}%s${RESET} %s" "$package_name" "${spin_chars[i]}" i=$(( (i + 1) % 10 )) sleep 0.3 @@ -111,6 +111,7 @@ uninstall_package() { # Checking if package is installed if sudo dpkg -l | grep -q -w "^ii $1" ; then echo -e "${NOTE} removing $pkg ..." + # shellcheck disable=SC2024 sudo apt autoremove -y "$1" >> "$LOG" 2>&1 | grep -v "error: target not found" if ! dpkg -l | grep -q -w "^ii $1" ; then diff --git a/install-scripts/gtk_themes.sh b/install-scripts/gtk_themes.sh index e7cc6fd..d740485 100755 --- a/install-scripts/gtk_themes.sh +++ b/install-scripts/gtk_themes.sh @@ -37,10 +37,11 @@ fi echo "$NOTE Cloning ${SKY_BLUE}GTK themes and Icons${RESET} repository..." 2>&1 | tee -a "$LOG" if git clone --depth=1 https://github.com/JaKooLit/GTK-themes-icons.git ; then - cd GTK-themes-icons + ( + cd GTK-themes-icons || exit 1 chmod +x auto-extract.sh ./auto-extract.sh - cd .. + ) echo "$OK Extracted GTK Themes & Icons to ~/.icons & ~/.themes directories" 2>&1 | tee -a "$LOG" else echo "$ERROR Download failed for GTK themes and Icons.." 2>&1 | tee -a "$LOG" diff --git a/install-scripts/hyprcursor.sh b/install-scripts/hyprcursor.sh index b726fac..a693d22 100755 --- a/install-scripts/hyprcursor.sh +++ b/install-scripts/hyprcursor.sh @@ -36,14 +36,14 @@ printf "${INFO} Installing ${YELLOW}hyprcursor $lang_tag${RESET} ...\n" if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprcursor.git; then cd hyprcursor || exit 1 cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build - cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF` + cmake --build ./build --config Release --target all -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)" if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then printf "${OK} ${MAGENTA}hyprcursor $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for ${YELLOW}hyprcursor $lang_tag${RESET}" 2>&1 | tee -a "$MLOG" fi #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for ${YELLOW}hyprcursor $lang_tag${RESET}" 2>&1 | tee -a "$LOG" diff --git a/install-scripts/hyprgraphics.sh b/install-scripts/hyprgraphics.sh index d680f2e..7212fd3 100755 --- a/install-scripts/hyprgraphics.sh +++ b/install-scripts/hyprgraphics.sh @@ -36,14 +36,14 @@ printf "${INFO} Installing ${YELLOW}hyprgraphics $lang_tag${RESET} ...\n" if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprgraphics.git; then cd hyprgraphics || exit 1 cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build - cmake --build ./build --config Release --target hyprgraphics -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF` + cmake --build ./build --config Release --target hyprgraphics -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)" if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then printf "${OK} ${MAGENTA}hyprgraphics $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for ${YELLOW}hyprgraphics $lang_tag${RESET}" 2>&1 | tee -a "$MLOG" fi #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for ${YELLOW}hyprgraphics $lang_tag${RESET}" 2>&1 | tee -a "$LOG" diff --git a/install-scripts/hypridle.sh b/install-scripts/hypridle.sh index e28cf21..bc2570c 100755 --- a/install-scripts/hypridle.sh +++ b/install-scripts/hypridle.sh @@ -47,14 +47,14 @@ printf "${INFO} Installing ${YELLOW}hypridle $idle_tag${RESET} ...\n" if git clone --recursive -b $idle_tag https://github.com/hyprwm/hypridle.git; then cd hypridle || exit 1 cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build - cmake --build ./build --config Release --target hypridle -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF` + cmake --build ./build --config Release --target hypridle -j"$(nproc 2>/dev/null || getconf NPROCESSORS_CONF)" if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then printf "${OK} ${MAGENTA}hypridle $idle_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for ${YELLOW}hypridle $idle_tag${RESET}" 2>&1 | tee -a "$MLOG" fi #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for ${YELLOW}hypridle $idle_tag${RESET}" 2>&1 | tee -a "$LOG" diff --git a/install-scripts/hyprland-protocols.sh b/install-scripts/hyprland-protocols.sh index 928be87..69af7cd 100755 --- a/install-scripts/hyprland-protocols.sh +++ b/install-scripts/hyprland-protocols.sh @@ -42,7 +42,7 @@ if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprland-protoco echo -e "${ERROR} Installation failed for ${YELLOW}hyprland-protocols $lang_tag${RESET}" 2>&1 | tee -a "$MLOG" fi #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for ${YELLOW}hyprland-protocols $lang_tag${RESET}" 2>&1 | tee -a "$LOG" diff --git a/install-scripts/hyprland-qt-support.sh b/install-scripts/hyprland-qt-support.sh index f39dba0..276a505 100755 --- a/install-scripts/hyprland-qt-support.sh +++ b/install-scripts/hyprland-qt-support.sh @@ -36,14 +36,14 @@ printf "${INFO} Installing ${YELLOW}hyprland-qt-support $lang_tag${RESET} ...\n" if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprland-qt-support.git; then cd hyprland-qt-support || exit 1 cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINSTALL_QML_PREFIX=/usr/lib/x86_64-linux-gnu/qt6/qml -S . -B ./build - cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF` + cmake --build ./build --config Release --target all -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)" if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then printf "${OK} ${MAGENTA}hyprland-qt-support $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for ${YELLOW}hyprland-qt-support $lang_tag${RESET}" 2>&1 | tee -a "$MLOG" fi #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for ${YELLOW}hyprland-qt-support $lang_tag${RESET}" 2>&1 | tee -a "$LOG" diff --git a/install-scripts/hyprland-qtutils.sh b/install-scripts/hyprland-qtutils.sh index 327bbc3..636a976 100755 --- a/install-scripts/hyprland-qtutils.sh +++ b/install-scripts/hyprland-qtutils.sh @@ -36,14 +36,14 @@ printf "${INFO} Installing ${YELLOW}hyprland-qtutils $lang_tag${RESET} ...\n" if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprland-qtutils.git; then cd hyprland-qtutils || exit 1 cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build - cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF` + cmake --build ./build --config Release --target all -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)" if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then printf "${OK} ${MAGENTA}hyprland-qtutils $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for ${YELLOW}hyprland-qtutils $lang_tag${RESET}" 2>&1 | tee -a "$MLOG" fi #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for ${YELLOW}hyprland-qtutils $lang_tag${RESET}" 2>&1 | tee -a "$LOG" diff --git a/install-scripts/hyprland.sh b/install-scripts/hyprland.sh index a86fb8a..f75db6b 100755 --- a/install-scripts/hyprland.sh +++ b/install-scripts/hyprland.sh @@ -43,7 +43,7 @@ if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprland.git; th echo -e "${ERROR} Installation failed for ${YELLOW}hyprland $lang_tag${RESET}" 2>&1 | tee -a "$MLOG" fi #moving the addional logs to Install-Logs directory - mv $MLOG ../Install-Logs/ || true + mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for ${YELLOW}hyprland $lang_tag${RESET}" 2>&1 | tee -a "$LOG" diff --git a/install-scripts/nvidia.sh b/install-scripts/nvidia.sh index 534b0eb..401adf2 100755 --- a/install-scripts/nvidia.sh +++ b/install-scripts/nvidia.sh @@ -7,7 +7,7 @@ nvidia_pkg=( nvidia-driver firmware-misc-nonfree nvidia-kernel-dkms - linux-headers-$(uname -r) + linux-headers-"$(uname -r)" libnvidia-egl-wayland1 libva-wayland2 libnvidia-egl-wayland1 diff --git a/install-scripts/sddm.sh b/install-scripts/sddm.sh index 3e4fe37..fd79030 100755 --- a/install-scripts/sddm.sh +++ b/install-scripts/sddm.sh @@ -55,6 +55,7 @@ done for login_manager in "${login[@]}"; do if dpkg -l | grep -q "^ii $login_manager"; then echo "Disabling $login_manager..." + # shellcheck disable=SC2024 sudo systemctl disable "$login_manager.service" >> "$LOG" 2>&1 || echo "Failed to disable $login_manager" >> "$LOG" echo "$login_manager disabled." fi @@ -64,6 +65,7 @@ done for manager in "${login[@]}"; do if systemctl is-active --quiet "$manager.service" > /dev/null 2>&1; then echo "$manager.service is active, disabling it..." >> "$LOG" 2>&1 + # shellcheck disable=SC2024 sudo systemctl disable "$manager.service" --now >> "$LOG" 2>&1 || echo "Failed to disable $manager.service" >> "$LOG" else echo "$manager.service is not active" >> "$LOG" 2>&1 diff --git a/install.sh b/install.sh index 3a15c00..a997891 100755 --- a/install.sh +++ b/install.sh @@ -337,9 +337,9 @@ execute_script "hyprcursor.sh" sleep 1 execute_script "hyprgraphics.sh" sleep 1 -execute_script "hypr-qt-support.sh" +execute_script "hyprland-qt-support.sh" sleep 1 -execute_script "hypr-qtutils.sh" +execute_script "hyprland-qtutils.sh" sleep 1 execute_script "hyprland.sh" sleep 1