I love the sunlight and dread the long, dark winter evenings of Northern Europe. I often look up sunrise / sunset times and count off the days until the darkness is gone.<p>Now I've written a terminal app for this (Mac/Linux)<p>Features: a colorful summary of daylight times for your location; projected change over the coming days; handles NO_COLOR and a ---short flag if you dislike the output format.<p>The location is IP-based but you can override this if you're on a VPN. Just create a terminal alias with the --loc flag. The app supports areas in the arctic / antarctic circle too.<p>Check our the repository for a preview and instructions on how you can install it with Homebrew.<p>(There is a Windows build but it's not yet tested)
I was curious how the times were obtained. It uses <a href="https://github.com/nathan-osman/go-sunrise" rel="nofollow">https://github.com/nathan-osman/go-sunrise</a> , which links to this calculation method: <a href="https://en.wikipedia.org/wiki/Sunrise_equation#Complete_calculation_on_Earth" rel="nofollow">https://en.wikipedia.org/wiki/Sunrise_equation#Complete_calc...</a>
Of course, you can get this information in Emacs, too. You'll need to get your lat and long, first:<p><pre><code> (setq calendar-latitude 12.3456
calendar-longitude -98.7654)
</code></pre>
Then, you can `M-x sunrise-sunset` and see the times (and total daylight hours) in the echo area.
Great looking app!!<p>I immediately checked how you do location lookups:<p><i>> IP lookup is powered by <a href="https://ipinfo.io" rel="nofollow">https://ipinfo.io</a>. They provide a good service so please don't spam requests.</i><p>There was a thread about them recently — the scale of their operation was very surprising.
I live in a place where it often rains, and I really love sunny weather. It makes me feel a bit down when I see that it's already dark by the time I get off work. I was wondering, since the Earth's revolution is taken into account, the time you get should be different every day, right?
Does this pull the times from an online service or are they calculated locally? I tried to read the code to work it out but I don't program in Go so I got a little lost