diff --git a/autopape.sh b/autopape.sh index dd155e5..f5784c5 100755 --- a/autopape.sh +++ b/autopape.sh @@ -1,23 +1,38 @@ #!/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" 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 c) command="${OPTARG}";; i) interval="${OPTARG}";; + + h) + usage + exit 0;; + *) - echo "Unrecognised option" + usage exit 1;; esac done - while [ true ] do for img in *