timomeh / Dunkl.app

Turn on dark mode in macOS after sunset
MIT License
7 stars 0 forks source link

New York #1

Closed jrub1 closed 7 years ago

jrub1 commented 7 years ago

Hi,

I'm trying to get this working for New York time zone (EST), but I can't seem to figure it out. I'm also getting an error when trying to run it for Berlin (the default) saying "Invalid date and time".

Thanks for making this! I wish flux would just add this feature back...

timomeh commented 7 years ago

Alright! I'll take a look at it in the next days, probably after the holidays. 🎄 I think I'll just make it an environment variable, so one could set it in the bashrc.

Hopefully this will also fix your problems with it completely not working. 🙈

timomeh commented 7 years ago

You can now change the time zone with putting the environment variable DUNKL_CITY in your .bashrc.

...or simply execute in your terminal: echo "export DUNKL_CITY=America/New_York" >> ~/.bashrc

Be sure to download the latest release. I encountered the "Invalid date and time"-Message also as I was working on this. Now it's gone and I don't see it anymore.

Could you please check if it works for you? If not, feel free to reopen this issue.

jrub1 commented 7 years ago

Thank you! It looks like it's happening again though :/ image

jrub1 commented 7 years ago

I can just click "ok" and it goes away but still looks like it's running though...I'll see if it changes to dark mode tonight.

timomeh commented 7 years ago

Aaaah I found the problem. I try to split the output of solunar (calculates sunrise/sunset) along linebreaks, so "\n", but when I save/bundle it, it becomes literally a line break in the code. Because Apple.

Still a mystery to me, why I thought 100% AppleScript would be the easiest way to build this.

But the keyword return does the trick. I'll push it now.

timomeh commented 7 years ago

Grab the newest release, should be fine now… hopefully.

jrub1 commented 7 years ago

I'm sorry to report... image

timomeh commented 7 years ago

Wtf AppleScript, 07:19 looks like a f***ing valid Time to me.

Urgh. But thanks for reporting.

I hate this sentence, but "it works for me". So it's hard for me to reproduce, but I'll try to solve this.

Can you just dismiss the message and test if the Application switches to dark mode/light mode, despite the error?

Thanks for your patience.

timomeh commented 7 years ago

I released a new version, which doesn't use AppleScript for checking time. I really really hope that it works for you.

Oh, and a happy new year! 🎉

jrub1 commented 7 years ago

It's working! Thanks! :) I'm not sure if I can confirm whether the time zone change worked though...

You too!!

timomeh commented 7 years ago

I'm really relieved that it works. 😄

If you mean by your uncertainty that it feels like it's switching to dark mode too early or vice versa: that's something I noticed, too. I tested the time zone change, it works. And then I realized a few things:

  1. The Timezone has nothing to do with sunrise/sunset.
    I'm using Berlin, because I'm living in Germany, but I'm really living in Cologne, not Berlin. Sunset in Berlin was 16:04 today, but 16:38 in Cologne. So it switched half an hour too early for me to dark mode. Yikes. I totally forgot how much impact this distance has on sunrise/sunset. Geo Coordinates would be much better.

  2. It's still "not-really-dark" outside after sunset.
    For example, darkness depends on how much the sun is below the horizon (There's a video by Tom Scott on Twilight and Night). Also I personally would like it to switch to dark mode in winter about an hour after sunset, if it's really dark – but I would not like it, if it switches to dark mode in summer also later, if it's really dark, around 23:00.

While I was ~developing~ bodging Dunkl.app, I decided to just stick with plain sunset/sunrise, because: this is just a Bodge, and I'm just waiting for f.lux to fix their dark mode option.
If f.lux doesn't fix this in the next months, I would be interested in developing a real application for handling this. With a GUI, Settings, Geo Location Services, and all that good stuff.

timomeh commented 7 years ago

@jrub1 Dark Mode is back in f.lux beta 39.6 – You can already download it here: https://forum.justgetflux.com/topic/3466/f-lux-beta-39-6

jrub1 commented 7 years ago

@timomeh Great! Just as you fixed the issue with your app :)

I'll probably stick with Dunkl for the time being as I'm always hesitant to use beta versions of things. And it's also good to know there's an option for those who don't want to use flux. Thanks again!