mirror of
https://github.imc.re/void-land/hyprland-void-dots
synced 2025-09-07 15:52:49 +02:00
26 lines
653 B
Bash
Executable file
26 lines
653 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
source ~/.config/scripts/env.sh
|
|
|
|
files=($(find "${WALLPAPERS_DIR}" -type f))
|
|
|
|
if [ ${#files[@]} -eq 0 ]; then
|
|
dunstify "No files found in the directory: ${WALLPAPERS_DIR}"
|
|
exit 1
|
|
fi
|
|
|
|
image_files=()
|
|
for file in "${files[@]}"; do
|
|
if file -b --mime-type "$file" | grep -q "^image/"; then
|
|
image_files+=("$file")
|
|
fi
|
|
done
|
|
|
|
if [ ${#image_files[@]} -eq 0 ]; then
|
|
dunstify "No image files found in the directory: ${WALLPAPERS_DIR}"
|
|
exit 1
|
|
fi
|
|
|
|
random_pic=${image_files[$RANDOM % ${#image_files[@]}]}
|
|
|
|
swww img "$random_pic" --transition-fps $SWWW_FPS --transition-type any --transition-duration $SWWW_DURATION
|