All Projects → troglobit → sun

troglobit / sun

Licence: Unlicense license
Simple library and application that shows sunset and sunrise based on your latitude,longitude

Programming Languages

c
50402 projects - #5 most used programming language
objective c
16641 projects - #2 most used programming language
Makefile
30231 projects
shell
77523 projects
M4
1887 projects

Projects that are alternatives of or similar to sun

go-sunrise
Go package for calculating the sunrise and sunset times for a given location
Stars: ✭ 42 (+82.61%)
Mutual labels:  sunrise, sunset
Daylight-Calendar-ICS
Daylight Calendar is a dynamically generated .ics calendar that you can host and subscribe to in Google Calendar, iCal, or other calendar software.
Stars: ✭ 22 (-4.35%)
Mutual labels:  sunrise, sunset
Sunscreen
🌅 A macOS app that sets your wallpaper based on sunrise and sunset.
Stars: ✭ 52 (+126.09%)
Mutual labels:  sunrise, sunset
sunrisesunset
🌅 Go package that provides the sunrise and sunset equation
Stars: ✭ 75 (+226.09%)
Mutual labels:  sunrise, sunset
astral
☀️ Go calculations for the position of the sun and moon.
Stars: ✭ 23 (+0%)
Mutual labels:  sunrise, sunset
astro
自用天文算法,公历农历转换、八大行星位置、日出日落月出月落时间、节气物候时间等
Stars: ✭ 33 (+43.48%)
Mutual labels:  sunrise, sunset
rust-sun
A Rust library for calculating sun positions
Stars: ✭ 31 (+34.78%)
Mutual labels:  sunrise, sunset
KosherCocoa
My Objective-C port of KosherJava. KosherCocoa enables you to perform sunrise-based and sunset-based calculations for Jewish prayer and calendar.
Stars: ✭ 49 (+113.04%)
Mutual labels:  sunrise, sunset
Solar-Calculator
Calculates the sunrise and sunset for a given date and location (using GEO coordinates). This library uses the method outlined NOAA Solar Calculations Day spreadsheet found at http://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html.
Stars: ✭ 36 (+56.52%)
Mutual labels:  sunrise, sunset
suncalc-py
A Python port of suncalc.js for calculating sun position and sunlight phases
Stars: ✭ 31 (+34.78%)
Mutual labels:  sunrise, sunset
sunraster
A SunPy-affiliated package which provides tools to analyze data from spectral data from any solar mission.
Stars: ✭ 19 (-17.39%)
Mutual labels:  sunrise
chmod-stego
A PoC on passing data through UNIX file privilege bits (RWX Triplets)
Stars: ✭ 23 (+0%)
Mutual labels:  unix
mg
OpenBSD Mg editor. Portable Public Domain Micro Emacs for *BSD, Cygwin, Linux, Mac OS X.
Stars: ✭ 99 (+330.43%)
Mutual labels:  unix
shod-old
hybrid (floating and tiling) tabbed window manager
Stars: ✭ 56 (+143.48%)
Mutual labels:  unix
connect-or-cut
Simple network sandbox for Unix and Windows
Stars: ✭ 19 (-17.39%)
Mutual labels:  unix
coreutils
Core utils re-implementation for UNIX/UNIX-like systems written in Rust
Stars: ✭ 96 (+317.39%)
Mutual labels:  unix
dotfiles
🍁 dotfiles || plain text configuration files for my linux system
Stars: ✭ 53 (+130.43%)
Mutual labels:  unix
Onyx
UNIX-like operating system written in C and C++
Stars: ✭ 52 (+126.09%)
Mutual labels:  unix
RCCpp-DearImGui-GLFW-example
Add Runtime Compiled C++ to the Dear ImGui example using the GLFW and OpenGL backend - with power saving
Stars: ✭ 61 (+165.22%)
Mutual labels:  unix
dproofreaders
Distributed Proofreaders is a web application intended to ease the process of converting public domain books into e-texts.
Stars: ✭ 35 (+52.17%)
Mutual labels:  public-domain

About

Simple public domain library and application that shows sunset and sunrise based on your latitude,longitude. The application can also be used with cron to run a script, see section Goal below.

The library, which can be used entirely stand-alone, is based on the excellent code by Paul Schlyter.

Example

Without any arguments the sun goes dumpster diving in system files /etc/timezone and /usr/share/zoneinfo/zone.tab to figure out your latitude and longitude.

On my system, in mid December here in Sweden, the result is:

$ cat /etc/timezone
Europe/Stockholm
$ sun
Sun rises 07:31, sets 13:49 UTC

You can set the environment variable TZ to check other locations:

$ TZ="Africa/Luanda" sun
Sun rises 04:42, sets 17:18 UTC

For more precision, you can of course provide your exact latitude and longitude. See the built-in usage text for more help: sun -h

Cron

To launch applications at sunrise/sunset using cron, simply:

$ crontab -e
01 00 * * * sun -r -w -o -30m; play english.au

This plays Linus Torvalds' classic audio file 30 minutes before sunrise.

NOTE: You may want to set the $PATH in your crontab, or use an absolute path to your programs, otherwise cron will not find them.

Usage

Usage:
  sun [-ahirsw] [-o OFFSET] [+/-latitude +/-longitude]

Options:
  -a      Show all relevant times and exit
  -l      Increased verbosity, enable log messages
  -h      This help text
  -i      Interactive mode
  -r      Sunrise mode
  -s      Sunset mode
  -u      Use UTC everywhere, not local time
  -v      Show program version and exit
  -w      Wait until sunset or sunrise
  -o ARG  Time offset to adjust wait, e.g. -o -30m
          maximum allowed offset: +/- 6h

Bug report address: https://github.com/troglobit/sun/issues

Goal

The goal of this project is to provide just enough intelligence to my home automation system so it can control the indoor lights, which are operated using 433 MHz outlet switches.

Building

The sun is built with the GNU configure and build system. Simply run the following commands to build and install:

$ ./configure
$ make
$ sudo make install

The sunriset.c code can be built as a library, use --enable-library with the configure script to enable this optional feature.

If you built from GIT, or have modified any of the .ac or .am files, you have to run the following to (re-)create the configure script:

.$ /autogen.sh

For that to work you need to have autoconf, automake, and libtool installed. These tools are not needed when building from an official released tarball.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].