aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts/WallpaperSelect.sh
diff options
context:
space:
mode:
authorEcys <73040912+Eccys@users.noreply.github.com>2024-07-06 05:10:01 +0000
committerGitHub <noreply@github.com>2024-07-06 05:10:01 +0000
commited9b40823b2b6227a8ba3257d8a49e43072ddad2 (patch)
treef56da6e968d0b9b469a3357fc9af3bcdfdf1f0e5 /config/hypr/UserScripts/WallpaperSelect.sh
parent8bac5ace152352b6ed95e1401823ffd9f3e3edff (diff)
Put random wallpaper in random selection
Shows preview of random wallpaper instead of blank screen.
Diffstat (limited to 'config/hypr/UserScripts/WallpaperSelect.sh')
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperSelect.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh
index 06859112..d2ca7c28 100755
--- a/config/hypr/UserScripts/WallpaperSelect.sh
+++ b/config/hypr/UserScripts/WallpaperSelect.sh
@@ -33,8 +33,8 @@ rofi_command="rofi -i -show -dmenu -config ~/.config/rofi/config-wallpaper.rasi"
# Sorting Wallpapers
menu() {
sorted_options=($(printf '%s\n' "${PICS[@]}" | sort))
- # Place ". random" at the beginning
- printf "%s\n" "$RANDOM_PIC_NAME"
+ # Place ". random" at the beginning with the random picture as an icon
+ printf "%s\x00icon\x1f%s\n" "$RANDOM_PIC_NAME" "$RANDOM_PIC"
for pic_path in "${sorted_options[@]}"; do
pic_name=$(basename "$pic_path")
# Displaying .gif to indicate animated images
@@ -59,7 +59,6 @@ main() {
# Random choice case
if [ "$choice" = "$RANDOM_PIC_NAME" ]; then
- RANDOM_PIC="${PICS[$((RANDOM % ${#PICS[@]}))]}"
swww img -o $focused_monitor "${RANDOM_PIC}" $SWWW_PARAMS
exit 0
fi
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage