if $1 is a path to an image, set that image as wallpaper and lockpaper

This commit is contained in:
Adithya 2023-05-18 20:10:15 +05:30
parent 9ca11eb0a9
commit ca4e7f7b2f
Signed by: adtya
GPG key ID: 48FC9915FFD326D0

View file

@ -7,13 +7,13 @@ if [ -z "$DIR" ]; then
echo "Usage: $0 <path to directory containing wallpapers>"
exit 1
fi
if [ ! -d "$DIR" ]; then
echo "$DIR: not a directory"
exit 1
fi
random_paper() {
if [ -d "$DIR" ] ; then
find -L "${DIR}"/ -type f -regextype egrep -regex ".*\.(jpe?g|png)$" | shuf -n1
elif [ -f "$DIR" ] ; then
echo "$DIR"
fi
}
swww query || swww init