Show HN: Daylight – track sunrise / sunset times in your terminal

by jbreckmckyeon 3/9/25, 12:21 PMwith 19 comments
by oftenwrongon 3/12/25, 10:23 AM

I was curious how the times were obtained. It uses https://github.com/nathan-osman/go-sunrise , which links to this calculation method: https://en.wikipedia.org/wiki/Sunrise_equation#Complete_calc...

by ndegruchyon 3/12/25, 12:45 PM

Of course, you can get this information in Emacs, too. You'll need to get your lat and long, first:

    (setq calendar-latitude  12.3456
          calendar-longitude -98.7654)
Then, you can `M-x sunrise-sunset` and see the times (and total daylight hours) in the echo area.

by rrr_oh_manon 3/12/25, 7:07 AM

Great looking app!!

I immediately checked how you do location lookups:

> IP lookup is powered by https://ipinfo.io. They provide a good service so please don't spam requests.

There was a thread about them recently — the scale of their operation was very surprising.

by japageton 3/12/25, 5:00 AM

Windows build works fine (Windows 10 Professional x64 22H2).

by JimmyDeepon 3/18/25, 1:03 AM

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?

by voidUpdateon 3/12/25, 3:27 PM

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

by thenthenthenon 3/12/25, 9:50 AM

Cool! Can we use the sky hue as Terminal background or overal “theme”?

by jrootabegaon 3/12/25, 2:01 PM

Is the noon color scheme supposed to look like Finn from Adventure Time?

by kseistrupon 3/12/25, 8:02 PM

This is nice, I like it!

Is there a way to make it use 24h time, rather than AM/PM?