From dd46262fdfaabebb6fd2213a9baec91dd4244086 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Thu, 13 Feb 2025 10:02:50 +0900 Subject: added -L on find command on some scripts to be more https://github.com/JaKooLit/Hyprland-Dots/issues/553 --- config/hypr/scripts/Animations.sh | 2 +- config/hypr/scripts/DarkLight.sh | 6 +++--- config/hypr/scripts/RofiThemeSelector.sh | 2 +- config/hypr/scripts/Sounds.sh | 8 ++++---- config/hypr/scripts/WaybarLayout.sh | 3 ++- config/hypr/scripts/WaybarStyles.sh | 4 +++- 6 files changed, 14 insertions(+), 11 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Animations.sh b/config/hypr/scripts/Animations.sh index b4d368e9..62c32257 100755 --- a/config/hypr/scripts/Animations.sh +++ b/config/hypr/scripts/Animations.sh @@ -15,7 +15,7 @@ UserConfigs="$HOME/.config/hypr/UserConfigs" rofi_theme="~/.config/rofi/config-Animations.rasi" # list of animation files, sorted alphabetically with numbers first -animations_list=$(find "$animations_dir" -maxdepth 1 -type f | sed 's/.*\///' | sed 's/\.conf$//' | sort -V) +animations_list=$(find -L "$animations_dir" -maxdepth 1 -type f | sed 's/.*\///' | sed 's/\.conf$//' | sort -V) # Rofi Menu chosen_file=$(echo "$animations_list" | rofi -i -dmenu -config $rofi_theme) diff --git a/config/hypr/scripts/DarkLight.sh b/config/hypr/scripts/DarkLight.sh index 783fa31a..662e1954 100755 --- a/config/hypr/scripts/DarkLight.sh +++ b/config/hypr/scripts/DarkLight.sh @@ -68,7 +68,7 @@ set_waybar_style() { waybar_style_link="$HOME/.config/waybar/style.css" style_prefix="\\[${theme}\\].*\\.css$" - style_file=$(find "$waybar_styles" -maxdepth 1 -type f -regex ".*$style_prefix" | shuf -n 1) + style_file=$(find -L "$waybar_styles" -maxdepth 1 -type f -regex ".*$style_prefix" | shuf -n 1) if [ -n "$style_file" ]; then ln -sf "$style_file" "$waybar_style_link" @@ -117,9 +117,9 @@ fi # Set Dynamic Wallpaper for Dark or Light Mode if [ "$next_mode" = "Dark" ]; then - next_wallpaper="$(find "${dark_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)" + next_wallpaper="$(find -L "${dark_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)" else - next_wallpaper="$(find "${light_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)" + next_wallpaper="$(find -L "${light_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)" fi # Update wallpaper using swww command diff --git a/config/hypr/scripts/RofiThemeSelector.sh b/config/hypr/scripts/RofiThemeSelector.sh index 420316bd..cbce04b0 100755 --- a/config/hypr/scripts/RofiThemeSelector.sh +++ b/config/hypr/scripts/RofiThemeSelector.sh @@ -16,7 +16,7 @@ menu() { options=() while IFS= read -r file; do options+=("$(basename "$file")") - done < <(find "$rofi_theme_dir" -maxdepth 1 -type f -exec basename {} \; | sort) + done < <(find -L "$rofi_theme_dir" -maxdepth 1 -type f -exec basename {} \; | sort) printf '%s\n' "${options[@]}" } diff --git a/config/hypr/scripts/Sounds.sh b/config/hypr/scripts/Sounds.sh index 9ab9127d..8b2cc76e 100755 --- a/config/hypr/scripts/Sounds.sh +++ b/config/hypr/scripts/Sounds.sh @@ -58,13 +58,13 @@ iTheme=$(cat "$sDIR/index.theme" | grep -i "inherits" | cut -d "=" -f 2) iDIR="$sDIR/../$iTheme" # Find the sound file and play it. -sound_file=$(find $sDIR/stereo -name "$soundoption" -print -quit) +sound_file=$(find -L $sDIR/stereo -name "$soundoption" -print -quit) if ! test -f "$sound_file"; then - sound_file=$(find $iDIR/stereo -name "$soundoption" -print -quit) + sound_file=$(find -L $iDIR/stereo -name "$soundoption" -print -quit) if ! test -f "$sound_file"; then - sound_file=$(find $userDIR/$defaultTheme/stereo -name "$soundoption" -print -quit) + sound_file=$(find -L $userDIR/$defaultTheme/stereo -name "$soundoption" -print -quit) if ! test -f "$sound_file"; then - sound_file=$(find $systemDIR/$defaultTheme/stereo -name "$soundoption" -print -quit) + sound_file=$(find -L $systemDIR/$defaultTheme/stereo -name "$soundoption" -print -quit) if ! test -f "$sound_file"; then echo "Error: Sound file not found." exit 1 diff --git a/config/hypr/scripts/WaybarLayout.sh b/config/hypr/scripts/WaybarLayout.sh index d6c4db83..fe16d3e1 100755 --- a/config/hypr/scripts/WaybarLayout.sh +++ b/config/hypr/scripts/WaybarLayout.sh @@ -2,6 +2,7 @@ # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # Script for waybar layout or configs +set -x IFS=$'\n\t' # Define directories @@ -15,7 +16,7 @@ menu() { options=() while IFS= read -r file; do options+=("$(basename "$file")") - done < <(find "$waybar_layouts" -maxdepth 1 -type f -exec basename {} \; | sort) + done < <(find -L "$waybar_layouts" -maxdepth 1 -type f -exec basename {} \; | sort) printf '%s\n' "${options[@]}" } diff --git a/config/hypr/scripts/WaybarStyles.sh b/config/hypr/scripts/WaybarStyles.sh index 62550ced..471c85e5 100755 --- a/config/hypr/scripts/WaybarStyles.sh +++ b/config/hypr/scripts/WaybarStyles.sh @@ -2,6 +2,8 @@ # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # Script for waybar styles +set -x + IFS=$'\n\t' # Define directories @@ -17,7 +19,7 @@ menu() { if [ -f "$waybar_styles/$file" ]; then options+=("$(basename "$file" .css)") fi - done < <(find "$waybar_styles" -maxdepth 1 -type f -name '*.css' -exec basename {} \; | sort) + done < <(find -L "$waybar_styles" -maxdepth 1 -type f -name '*.css' -exec basename {} \; | sort) printf '%s\n' "${options[@]}" } -- cgit v1.2.3