about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <30861839+Baitinq@users.noreply.github.com>2019-10-17 00:35:29 +0100
committerGitHub <noreply@github.com>2019-10-17 00:35:29 +0100
commit6097822c50d68deb4341b4c95945ab41f0b385fd (patch)
tree5584019f46eb30da8c47dc770fe7b5acd7f6544a
parentRemoved -o option (diff)
parentFixed issue where script would crash without a framerate input. (diff)
downloadsmart-wallpaper-6097822c50d68deb4341b4c95945ab41f0b385fd.tar.gz
smart-wallpaper-6097822c50d68deb4341b4c95945ab41f0b385fd.tar.bz2
smart-wallpaper-6097822c50d68deb4341b4c95945ab41f0b385fd.zip
Merge pull request #3 from Thytom/master
Cleanup and Framerate Bug Fix
-rwxr-xr-xsmart-wallpaper22
1 files changed, 12 insertions, 10 deletions
diff --git a/smart-wallpaper b/smart-wallpaper
index 8260650..0ddc2cc 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 [[ ! $framerate = '' ]]; then
+	delay_flag="--delay $(expr 100 / $framerate)"
+fi
 
 while true
 do