Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…papers into main
  • Loading branch information
lennart-rth committed Nov 8, 2022
2 parents 887a00c + 8d58886 commit ca0ce7c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@
Set your Desktop background to near realtime picures of the earth. \
Supports all known **geostationary** satellites, high resolution **sentinel** images and Nasa **Solar Dynamics Observatory** Images!

<h3>Installation for LINUX and MacOS</h3>
### Installation
1. Download latest release and unzip it.
2. Place it somewhere appropriate. For example in `/usr/bin/`
3. Execute `install.sh` and pass all the parameter you want for your Desktop image. E.g. `install.sh -s meteosat-11 -z 3`
4. That's it! You can test your installation by calling the binary with `-dir` set to `./`.\
E.g. for Linux `./changeBackground -dir ./`

<details>
<summary><h3>Manual setup and installation for LINUX and MacOS</h3></summary>


1. `git clone https://github.com/L-Roth/Live-Earth-Wallpapers.git`
2. `cd Live-Earth-Wallpapers`
Expand All @@ -18,8 +27,10 @@ Supports all known **geostationary** satellites, high resolution **sentinel** im
**Do not include the brackets!**
5. Check if crontab is installed: `crontab -l`\
*For mac: Depending on your Security Settings you might need to add the newly created venv to the $PATH. See this [post on StackOverflow](https://stackoverflow.com/a/65831474)*
</details>

<h3>Installation for Windows</h3>
<details>
<summary><h3>Manual setup and Installation for Windows</h3></summary>

*(Disclamer: Windows setup by `install.sh` and the `-p windows` flag is not tested yet, as I have no access to a Windows mashine.)*
1. `git clone https://github.com/L-Roth/Live-Earth-Wallpapers.git`
Expand All @@ -28,9 +39,9 @@ E.g.: `path_to_project/Live-Earth-Wallpapers/venv/Scripts/python.exe path_to_pro
Manual setup is recommended however you can use `./install.sh` to setup a Task Scheduler. Make sure to execute this with **System Adminstrator Rights**!
3. Use -p flag with "windows" or use programms like [backgroundswitcher](https://johnsad.ventures/software/backgroundswitcher/windows/) or [bionix](https://bionixwallpaper.com/desktop-wallpaper-app-download/) to periodicly change your background to the image `backgroundImage.png` in the project folder.
Make sure to update image 2-3 min. later than the TaskScheduler runs.

</details>
<details>
<summary><h3>Manual installation</h3></summary>
<summary><h3>Even more manual installation</h3></summary>

1. `git clone https://github.com/L-Roth/Live-Earth-Wallpapers.git`
2. `python3 -m venv venv`
Expand Down
12 changes: 12 additions & 0 deletions changeBackground.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"sdo",
]

sizes = [678, 1356,2227, 5424, 10848]


def parseArgs():
parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -121,6 +123,16 @@ def parseArgs():
#this is where the internal image file is store
if args.directory is None:
args.directory = os.path.dirname(os.path.realpath(__file__))
if (
args.width is not None or args.height is not None
) and args.source != "sentinel":
smaller = min([args.width if args.width is not None else sys.maxsize, args.height if args.height is not None else sys.maxsize])

for i in range(0, len(sizes)):
if smaller < sizes[i]:
break

args.zoomLevel = i

if args.source is None:
args.source = random.choice(random_sources)
Expand Down

0 comments on commit ca0ce7c

Please sign in to comment.