coding/wallpaper/hyprland/wallpaper-picker
denode 06c0fbb8e9 On branch master
renamed:    music-notify -> bin/music-notify
 	renamed:    motd.sh -> mensa/motd.sh
 	renamed:    motdmb.sh -> mensa/motdmb.sh
 	deleted:    testing-wallpaper
 	renamed:    wallpaper-picker -> wallpaper/hyprland/wallpaper-picker
 	new file:   wallpaper/niri/README.md
 	renamed:    wallpaper-niri -> wallpaper/niri/wallpaper-niri
	new file:   wallpaper/niri/wallpaper.rasi
2026-04-02 08:39:40 +02:00

39 lines
1 KiB
Text
Executable file

#!/bin/bash
# wallpaper-picker.sh
WALLPAPER_DIR="$HOME/Pictures/wallpaper"
EXTENSIONS="jpg|jpeg|png|gif|webp|bmp|tiff|tga|svg|avif"
declare -A wall_map
while IFS= read -r path; do
name=$(basename "$path")
wall_map["$name"]="$path"
done < <(find "$WALLPAPER_DIR" -maxdepth 1 -type f \
-regextype posix-extended -iregex ".*\.($EXTENSIONS)" | sort)
chosen=$(printf '%s\n' "${!wall_map[@]}" | sort | \
wofi \
--dmenu \
--prompt " Wallpaper" \
--insensitive \
--no-actions \
--width 500 \
--height 400 \
)
[[ -z "$chosen" ]] && exit 0
full_path="${wall_map[$chosen]}"
[[ ! -f "$full_path" ]] && {
notify-send "wallpaper-picker" "Not found: $full_path" --urgency=critical
exit 1
}
awww img "$full_path" --transition-type grow --transition-step 90
persist="$HOME/.config/hypr/wallpaper-restore.sh"
printf '#!/bin/bash\nawww-daemon &\nsleep 0.5\nawww img "%s" --transition-type simple\n' "$full_path" > "$persist"
chmod +x "$persist"
notify-send "Wallpaper" "$chosen" --urgency=low