Add help message to autopape.sh

This commit is contained in:
2024-07-04 20:22:07 +01:00
parent 33057b3fbc
commit c03c6a6989

View File

@ -1,23 +1,38 @@
#!/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 specified interval
command="feh --bg-fill" command="feh --bg-fill"
interval="1m" interval="1m"
while getopts 'c:i:' flag; do usage() {
cat << EOF
Usage: autopape.sh [OPTIONS]... [ARGUMENTS]...
Iterate over the files in a directory and set them as the desktop wallpaper at a regular interval.
Options:
-c Specify the command that should be used to set the wallpaper. Defaults to 'feh --bg-fill'
-h Print this help message
-i Specify the interval between wallpaper changes. Defaults to '1m'
EOF
}
while getopts 'c:i:h' flag; do
case "${flag}" in case "${flag}" in
c) c)
command="${OPTARG}";; command="${OPTARG}";;
i) i)
interval="${OPTARG}";; interval="${OPTARG}";;
h)
usage
exit 0;;
*) *)
echo "Unrecognised option" usage
exit 1;; exit 1;;
esac esac
done done
while [ true ] while [ true ]
do do
for img in * for img in *