add -c flag to autopape.sh

This commit is contained in:
2024-04-26 20:16:29 +01:00
parent f243d5fb19
commit fac2150928

View File

@ -1,17 +1,20 @@
#!/bin/sh #!/bin/sh
# simple script to loop through each image in a directory and set said image as wallpaper for a specififed interval using feh # simple script to loop through each image in a directory and set said image as wallpaper for a specififed interval using feh
command="feh --bg-fill"
interval="1m" interval="1m"
while getopts 'c:i:' flag; do
case "${flag}" in
c)
command="${OPTARG}";;
while getopts 'i:' flag; do
case "${flag}" in
i) i)
interval="${OPTARG}";; interval="${OPTARG}";;
*) *)
echo "Unrecognised option" echo "Unrecognised option"
exit 1;; exit 1;;
esac esac
done done
@ -19,7 +22,7 @@ while [ true ]
do do
for img in * for img in *
do do
feh --bg-fill "$img" eval "$command" "$img"
sleep "$interval" sleep "$interval"
done done
done done