←back to thread

79 points jbreckmckye | 1 comments | | HN request time: 0s | source

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.

Now I've written a terminal app for this (Mac/Linux)

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.

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.

Check our the repository for a preview and instructions on how you can install it with Homebrew.

(There is a Windows build but it's not yet tested)

Show context
voidUpdate ◴[] No.43344274[source]
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
replies(1): >>43345846 #
jbreckmckye ◴[] No.43345846[source]
It gets your latitude/longitude from an IP lookup service, then does a geometric calculation locally
replies(1): >>43347359 #
jmholla ◴[] No.43347359[source]
Is there a configuration file or command line option to provide location information manually?
replies(1): >>43347707 #
1. jbreckmckye ◴[] No.43347707[source]
Yes, you can use `--loc="12.34,56.78"` where the values are longitude and latitude.

You can also override the Timezone with `--timezone` (passing an IANA timezone e.g. America/New_York).