aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/WallpaperSelect.sh
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2023-11-27 13:53:48 +0900
committerGitHub <noreply@github.com>2023-11-27 13:53:48 +0900
commit8eeed24b9579cf4cc76cc67dc4b5c73b2ef34573 (patch)
tree2115df3ef73ea54d71ba9ff84364c690b591af44 /config/hypr/scripts/WallpaperSelect.sh
parent4502d47a44dd46306e0803ec0b27a0db48b2819c (diff)
parentf981d4fbbfb5f853b491a062e6e9017669102115 (diff)
Merge pull request #37 from JaKooLit/v2.1.10
V2.1.10
Diffstat (limited to 'config/hypr/scripts/WallpaperSelect.sh')
-rwxr-xr-xconfig/hypr/scripts/WallpaperSelect.sh20
1 files changed, 13 insertions, 7 deletions
diff --git a/config/hypr/scripts/WallpaperSelect.sh b/config/hypr/scripts/WallpaperSelect.sh
index d748318a..0d899a10 100755
--- a/config/hypr/scripts/WallpaperSelect.sh
+++ b/config/hypr/scripts/WallpaperSelect.sh
@@ -1,6 +1,9 @@
#!/bin/bash
+
+SCRIPTSDIR="$HOME/.config/hypr/scripts"
+
# WALLPAPERS PATH
-DIR=$HOME/Pictures/wallpapers
+DIR="$HOME/Pictures/wallpapers/"
# Transition config
FPS=30
@@ -25,13 +28,14 @@ menu() {
for i in "${!PICS[@]}"; do
# Displaying .gif to indicate animated images
if [[ -z $(echo "${PICS[$i]}" | grep .gif$) ]]; then
- printf "$i. $(echo "${PICS[$i]}" | cut -d. -f1)\n"
+ filename=$(basename "${PICS[$i]}" | sed 's/\.[^.]*$//') # Remove file extension
+ printf "%s\n" "${filename//[[:digit:]]/}" # Remove leading numbers
else
- printf "$i. ${PICS[$i]}\n"
+ printf "%s\n" "${PICS[$i]}"
fi
done
- printf "$RANDOM_PIC_NAME"
+ printf "%s\n" "$RANDOM_PIC_NAME"
}
swww query || swww init
@@ -50,7 +54,7 @@ main() {
exit 0
fi
- pic_index=$(echo "$choice" | cut -d. -f1)
+ pic_index=$(printf '%s\n' "${!PICS[@]}" | grep -E "\b${choice}\b") # Get index based on choice
swww img "${DIR}/${PICS[$pic_index]}" $SWWW_PARAMS
}
@@ -62,5 +66,7 @@ fi
main
-$HOME/.config/hypr/scripts/PywalSwww.sh &
-$HOME/.config/hypr/scripts/Refresh.sh
+${SCRIPTSDIR}/PywalSwww.sh &
+${SCRIPTSDIR}/Refresh.sh &
+sleep 1
+${SCRIPTSDIR}/PywalDunst.sh
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage