This commit is contained in:
parent
ffd89a2bbb
commit
40c90f7fee
@ -10,7 +10,16 @@ if ! [ -d "$WALLPAPER_DIR" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$#" -eq 1 ]; then
|
||||||
|
wallpaper_path="$1"
|
||||||
|
ext=$(file --extension "$wallpaper_path" | cut -d" " -f2)
|
||||||
|
if ! [ "$ext" == "png" ]; then
|
||||||
|
echo "$wallpaper_path is an invalid wallpaper"
|
||||||
|
fi
|
||||||
|
else
|
||||||
wallpaper_path=$(find "$WALLPAPER_DIR" -mindepth 1 | grep png| sort -R | tail -n 1)
|
wallpaper_path=$(find "$WALLPAPER_DIR" -mindepth 1 | grep png| sort -R | tail -n 1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -z "$wallpaper_path" ]; then
|
if [ -z "$wallpaper_path" ]; then
|
||||||
echo "Unable to find wallpaper"
|
echo "Unable to find wallpaper"
|
||||||
|
Loading…
Reference in New Issue
Block a user