From c03c6a6989780d2efc1c9e6d6df14135dd89a20e Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 4 Jul 2024 20:22:07 +0100 Subject: [PATCH] Add help message to autopape.sh --- autopape.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) 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 *