Just find pictures (#499)

Filter the pictures in directory by file extensions
This commit is contained in:
mhdzli 2020-03-16 04:22:24 +03:30 committed by GitHub
parent db46b82f7f
commit 9e4cfc127d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,7 @@
[ -f "$1" ] && cp "$1" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Wallpaper changed." [ -f "$1" ] && cp "$1" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Wallpaper changed."
[ -d "$1" ] && mv "$(find "$1" -type f | shuf -n 1)" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Random Wallpaper chosen." [ -d "$1" ] && mv "$(find "$1"/*.{jpg,jpeg,png} -type f | shuf -n 1)" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Random Wallpaper chosen."
# If pywal is installed, use it. # If pywal is installed, use it.
type wal >/dev/null 2>&1 && { wal -c ; type wal >/dev/null 2>&1 && { wal -c ;