From 9e4cfc127d33980d4e037d17fc3abb439d7363b3 Mon Sep 17 00:00:00 2001 From: mhdzli <50514359+mhdzli@users.noreply.github.com> Date: Mon, 16 Mar 2020 04:22:24 +0330 Subject: [PATCH] Just find pictures (#499) Filter the pictures in directory by file extensions --- .local/bin/setbg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/setbg b/.local/bin/setbg index ea5bc14..728df4c 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -10,7 +10,7 @@ [ -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. type wal >/dev/null 2>&1 && { wal -c ;