This commit is contained in:
2025-10-29 20:54:56 +09:00
parent 5a70da2880
commit f0e4d7844e
2 changed files with 9 additions and 4 deletions
+6 -1
View File
@@ -4,8 +4,13 @@ set -euo pipefail
WALLS="${HOME}/wallpapers"
# Pick up wallpaper(jpg/jpeg/png/webp)
if ! swww query >/dev/null 2>&1; then
swww init
fi
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[@]}]}"