mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-07 21:04:09 +09:00
fix bug
This commit is contained in:
@@ -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[@]}]}"
|
||||
|
||||
Reference in New Issue
Block a user