diff --git a/README.md b/README.md index f9b5910..d5df2b8 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,11 @@ ## Übersicht Widget to Earth View bacground By Nicholas Maggio + +## Edited repository +By David Brooks + +I have changed the command of the original repo +In the old command, refresh did not cuase the random number to change +This new command uses BASH's random and so it is updated each time +the command is rerun/refreshed diff --git a/earth-view.widget.zip b/earth-view.widget.zip index 3dfb9a1..0b528f8 100644 Binary files a/earth-view.widget.zip and b/earth-view.widget.zip differ diff --git a/earth-view.widget/index.coffee b/earth-view.widget/index.coffee index 3a352c5..3a8fd24 100644 --- a/earth-view.widget/index.coffee +++ b/earth-view.widget/index.coffee @@ -1,5 +1,14 @@ # get random image from list of 100 -command: "curl -so earth-view.widget/images/img.jpg earthview.withgoogle.com/images/wallpaper/"+ Math.floor(Math.random() * (101 - 1) + 1) + ".jpg" + +# Command changed by David Brooks - https://github.com/djbrooks111 +# In the old command, refresh did not cause the random number to change +# This new command uses BASH's random and so it is updated each time +# the command is rerun/refreshed + +command: "num=$(($RANDOM % 100 + 1)); curl -so earth-view.widget/images/img.jpg earthview.withgoogle.com/images/wallpaper/${num}.jpg" + +#command: "curl -so earth-view.widget/images/img.jpg earthview.withgoogle.com/images/wallpaper/"+ Math.floor(Math.random() * (101 - 1) + 1) + ".jpg" + # Set the refresh frequency (milliseconds). refreshFrequency: 200000