mczachurski / wallpapper

:computer: Console application for creating dynamic wallpapers for macOS Mojave and newer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Comparing Altitude / Azimuths

JCsplash opened this issue · comments

@mczachurski Hey Marcin thanks for this great library and all the articles you've written. I've read them all but still can't seem to figure out how Apple compares a user's current Altitude / Azimuth Pair with the Dynamic Wallpapers' to determine which image to show.

I'd like to be able to predict which dynamic images will be shown when based on location coordinates. Any ideas here? Thanks so much.

Hi, Apple didn't use user coordinates (directly) at all. For them the most important thing is position of the Sun on the sky. Each image has assigned Sun position. When Sun in user location has similar position to position connected with image then image will appear on you desktop.

Thus to change the wallpaper you need to change the system time, the user's location also has an impact, because in a different position the Sun is at 4pm in Norway and in another at the same time in Greece.

Of course, it is not possible to determine the exact time when the change will occur. It depends on how often the system verifies the position of the Sun and how accurate data it receives.

Hi @mczachurski thanks for the reply. I'm trying to mimic the system's wallpaper display mechanism, by programmatically determining which index of an heic to show.

You said "When Sun in user location has similar position to position connected with image then image will appear on you desktop." I'm trying to find out how the comparison is done.

I tried getting and comparing the angular distance between two alt/azimuth pairs (the user's current pair based on location and the heic's pairs) -- however, the pair with the nearest angular distance is often not linked with the image that the system displays.

Let me know if you find an easier way.

I don't know exactly when and how Apple implemented these mechanism. It is for us like a black-box unfortunatelly. There is other issue where people tries to figure out how Apple implemented this.