about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-10-16 23:52:16 +0100
committerArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-10-16 23:52:16 +0100
commitda3f471fa05949c3c619287083263b676f7031fd (patch)
tree2a5c865d72cab77205b9ee307e012c72813bd282
parentRemoved -o option (diff)
downloadsmart-wallpaper-da3f471fa05949c3c619287083263b676f7031fd.tar.gz
smart-wallpaper-da3f471fa05949c3c619287083263b676f7031fd.tar.bz2
smart-wallpaper-da3f471fa05949c3c619287083263b676f7031fd.zip
Updated print_usage() to only use one echo command.
You can use one multiline string instead.
-rwxr-xr-xsmart-wallpaper22
1 files 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