if $1 is a path to an image, set that image as wallpaper and lockpaper
This commit is contained in:
parent
9ca11eb0a9
commit
ca4e7f7b2f
1 changed files with 5 additions and 5 deletions
|
@ -7,13 +7,13 @@ if [ -z "$DIR" ]; then
|
||||||
echo "Usage: $0 <path to directory containing wallpapers>"
|
echo "Usage: $0 <path to directory containing wallpapers>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ ! -d "$DIR" ]; then
|
|
||||||
echo "$DIR: not a directory"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
random_paper() {
|
random_paper() {
|
||||||
|
if [ -d "$DIR" ] ; then
|
||||||
find -L "${DIR}"/ -type f -regextype egrep -regex ".*\.(jpe?g|png)$" | shuf -n1
|
find -L "${DIR}"/ -type f -regextype egrep -regex ".*\.(jpe?g|png)$" | shuf -n1
|
||||||
|
elif [ -f "$DIR" ] ; then
|
||||||
|
echo "$DIR"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
swww query || swww init
|
swww query || swww init
|
||||||
|
|
Loading…
Reference in a new issue