JohnCoates / Aerial

Apple TV Aerial Screensaver for Mac
MIT License
20.78k stars 1.05k forks source link

About Nightshift #1019

Closed glouel closed 4 years ago

glouel commented 4 years ago

Thanks for the extended information, and my apologies for using the term "Entitlement" in a confusingly inconsistent manor. Rather then clarifying what I meant it seems I only made matters worse and your extensive explanation resolved most of my confusion and curiosity.

I may or may not have actually closed System Preferences during one of the times I tried manually installing 1.9.2, so based on what I learned from you above I think most likely explanation the manual install wasn't shown as installed in the System Preferences UI is that I had not closed the System Prefs.app.

The only outstanding question I had from my poorly worded original question was wether or not the Time Tab UI always used the Display hack you mentioned each time a user click on the Tab? If not then it's possible data could be stale in the case of someone turning nightshift on the first time. This shouldn't have been true in my current case but peaked my curiosity. I assume you didn't want to use the location APIs so as not to raise user suspicion and protect privacy (which I applaud).

One curiosity noticed the system display API for sunrise/set (you mentioned) and Goggle's sunrise/set are different (by more than what I would consider to be an insignificant drift). In my case...

Night Shift Sunset/Sunrise { isDaylight = 1; nextSunrise = "2020-07-12 13:03:15 +0000"; nextSunset = "2020-07-12 03:28:08 +0000"; previousSunrise = "2020-07-10 13:01:57 +0000"; previousSunset = "2020-07-10 03:28:54 +0000"; sunrise = "2020-07-11 13:02:35 +0000"; sunset = "2020-07-11 03:28:32 +0000"; }

Translating I believe to (Sunrise on 7-11-20) @ 5:02:35 am & 8:28 pm (Sunset 7-11-20) VS 5:57 am & 8:32 pm from Google & https://www.timeanddate.com/sun/usa/san-francisco

One of life's little mysteries I suppose and only mentioned here as you seem to have spent some time posting around nightshift. If have any thoughts on this or my UI clarification perhaps DM would be best as I have strayed FAR the original topic/subject and doubt there is any one else likely interested in the specifics I mentioned.

Thanks again for you time, Tom

--

Originally posted by @taw123 in https://github.com/JohnCoates/Aerial/issues/1008#issuecomment-657123696

glouel commented 4 years ago

Reposting here to answer your questions.

Thanks for the extended information, and my apologies for using the term "Entitlement" in a confusingly inconsistent manor. Rather then clarifying what I meant it seems I only made matters worse and your extensive explanation resolved most of my confusion and curiosity.

No worries, the Time tab is a bit confusing, I need to clean it up a bit.

The only outstanding question I had from my poorly worded original question was wether or not the Time Tab UI always used the Display hack you mentioned each time a user click on the Tab?

So no, Aerial gathers the nightshift information when it starts. In the case of the control panel, that would be only when you launch it the first time, until you close System Preferences.

If not then it's possible data could be stale in the case of someone turning nightshift on the first time. This shouldn't have been true in my current case but peaked my curiosity. I assume you didn't want to use the location APIs so as not to raise user suspicion and protect privacy (which I applaud).

But be aware that, as I mentionned, most of the time (but weirdly, not all the time), when you launch the screensaver for real, you usually get a separate instance of Aerial, so it will do the nightshift check there. Screensavers are plugins to two different things, the System Preference panel, and ScreenSaverEngine (the "real" screensaver launcher).

So let's say you never close system preferences for months, you'd still get the correct calculation each time the screensaver start despite that. Does that make sense ?

One curiosity noticed the system display API for sunrise/set (you mentioned) and Goggle's sunrise/set are different (by more than what I would consider to be an insignificant drift). In my case...

Night Shift Sunset/Sunrise { isDaylight = 1; nextSunrise = "2020-07-12 13:03:15 +0000"; nextSunset = "2020-07-12 03:28:08 +0000"; previousSunrise = "2020-07-10 13:01:57 +0000"; previousSunset = "2020-07-10 03:28:54 +0000"; sunrise = "2020-07-11 13:02:35 +0000"; sunset = "2020-07-11 03:28:32 +0000"; }

Translating I believe to (Sunrise on 7-11-20) @ 5:02:35 am & 8:28 pm (Sunset 7-11-20) VS 5:57 am & 8:32 pm from Google & https://www.timeanddate.com/sun/usa/san-francisco

So my guess is that it's more likely 6:02/8:28. About a 4/5 mins drift both ways, which is expected.

One of life's little mysteries I suppose and only mentioned here as you seem to have spent some time posting around nightshift. If have any thoughts on this or my UI clarification perhaps DM would be best as I have strayed FAR the original topic/subject and doubt there is any one else likely interested in the specifics I mentioned.

I wrote a bit about that a while ago, for some reason Apple chose a very non standard way of calculating sunrise and sunset. If you use the location option in the time tab instead of nightshift, I give you the option for a few calculation methods (official, civil, etc), it's all about which degree you pick for the calculation.

Here's the explanation for the discrepancy from back when I implemented the feature (and just before I added the multiple calculations) : https://github.com/JohnCoates/Aerial/issues/580#issuecomment-433134834

If you want the exact calculations, don't use night shift, use the calculate from long/lat option just above, press the compass to grab your coordinates (in that case, you do need location services !) and you can pick the calculation method. There, you'll probably be spot on with what you found at your link.

Again, that UI is a bit complex, really need to clean that up, I'll have a look for 2.0 :)

taw123 commented 4 years ago

Thanks for everything. I'll check out the links in a couple days when I get a chance. I was indeed curious there were so many options in Lat/Long section so it should make for some interesting reading next weekend when I HOPEFULLY get some free time to read. For now I am certainly fine with the Nightshift location as this is ultimately a purely a cosmetic issue of very low importance.

Hopefully version 2 (whatever and whenever it is/becomes), will continue to support Seirra as I am still likely months away from being able to update to Catalina or perhaps just directly to Big Sur when the time comes....

👍

glouel commented 4 years ago

Yes, there's no plan to drop anything in terms of support of older macOS versions. As of right now it supports 10.12 min, if anything the support may go back down to 10.9/10.10 depending on if I get rid of Sparkle in the screensaver or not. There are a couple of limitations on older OSes but nothing major.

if you are curious and want to see the work in progress, check this thread : https://github.com/JohnCoates/Aerial/issues/1006