Files
dotfiles/modules/home/wallpaper/set-wallpaper.sh
T
2025-10-29 20:42:17 +09:00

14 lines
411 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# set-wallpaper.sh
set -euo pipefail
WALLS="${HOME}/wallpapers"
# Pick up wallpaper(jpg/jpeg/png/webp)
mapfile -t files < <(find "$WALLS" -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \))
[[ ${#files[@]} -gt 0 ]] || exit 0
pick="${files[RANDOM % ${#files[@]}]}"
exec swww img "$pick" --transition-type any --transition-step 90 --transition-fps 60