From da3f471fa05949c3c619287083263b676f7031fd Mon Sep 17 00:00:00 2001 From: "Archie Hilton (thytom)" Date: Wed, 16 Oct 2019 23:52:16 +0100 Subject: Updated print_usage() to only use one echo command. You can use one multiline string instead. --- smart-wallpaper | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/smart-wallpaper b/smart-wallpaper index 8260650..2089958 100755 --- a/smart-wallpaper +++ b/smart-wallpaper @@ -31,15 +31,15 @@ cleanup() { } print_usage() { - echo "Usage: smart-wallpaper [FLAG]" - echo " Flags:" - echo " [-d]: NEEDED : daytime wallpaper file/folder" - echo " [-n]: NEEDED : nighttime wallpaper file/folder" - echo " [-l]: OPTIONAL : manual location (lat:long), if not added geoclue gets the location (requires internet)" - echo " [-t]: OPTIONAL : set the time period (seconds) for the script to check if it is day or night " - echo " [-f]: OPTIONAL : set the framerate for the gif. Lower framerates = lower CPU usage." - echo " [-r]: OPTIONAL : changes the wallpaper every day/night iteration" - echo " [-h]: OPTIONAL : print help message" + echo "Usage: smart-wallpaper [FLAG] + Flags: + [-d]: NEEDED : daytime wallpaper file/folder + [-n]: NEEDED : nighttime wallpaper file/folder + [-l]: OPTIONAL : manual location (lat:long), if not added geoclue gets the location (requires internet) + [-t]: OPTIONAL : set the time period (seconds) for the script to check if it is day or night + [-f]: OPTIONAL : set the framerate for the gif. Lower framerates = lower CPU usage. + [-r]: OPTIONAL : changes the wallpaper every day/night iteration + [-h]: OPTIONAL : print help message" } set_wallpaper() { @@ -163,7 +163,9 @@ if [ "$randomize" == false ]; then nighttimewallpaper=$(find $input_nighttimewallpaper -type f | shuf -n 1) fi -delay_flag="--delay $(expr 100 / $framerate)" +if [[ -z $framerate ]]; then + delay_flag="--delay $(expr 100 / $framerate)" +fi while true do -- cgit 1.4.1