{"id":13577679,"url":"https://github.com/troglobit/sun","last_synced_at":"2025-03-18T22:31:28.645Z","repository":{"id":136803967,"uuid":"113698960","full_name":"troglobit/sun","owner":"troglobit","description":"Simple library and application that shows sunset and sunrise based on your latitude,longitude","archived":false,"fork":false,"pushed_at":"2024-02-06T11:32:04.000Z","size":42,"stargazers_count":26,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T00:34:09.605Z","etag":null,"topics":["c","linux","public-domain","sunrise","sunset","unix"],"latest_commit_sha":null,"homepage":"http://latitudelongitude.org/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/troglobit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-09T20:26:24.000Z","updated_at":"2024-10-17T22:26:58.000Z","dependencies_parsed_at":"2024-01-16T20:24:33.597Z","dependency_job_id":"8a30f41a-94c9-43bd-a6b2-a89312cb74b7","html_url":"https://github.com/troglobit/sun","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fsun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fsun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fsun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fsun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/troglobit","download_url":"https://codeload.github.com/troglobit/sun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244318692,"owners_count":20433965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","linux","public-domain","sunrise","sunset","unix"],"created_at":"2024-08-01T15:01:23.529Z","updated_at":"2025-03-18T22:31:28.341Z","avatar_url":"https://github.com/troglobit.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"About\n-----\n\nSimple public domain library and application that shows sunset and\nsunrise based on your latitude,longitude.  The application can also\nbe used with cron to run a script, see section Goal below.\n\nThe library, which can be used entirely stand-alone, is based on the\nexcellent code by [Paul Schlyter][].\n\n\nExample\n-------\n\nWithout any arguments the `sun` goes dumpster diving in system files\n`/etc/timezone` and `/usr/share/zoneinfo/zone.tab` to figure out\nyour latitude and longitude.\n\nOn my system, in mid December here in Sweden, the result is:\n\n```sh\n$ cat /etc/timezone\nEurope/Stockholm\n$ sun\nSun rises 07:31, sets 13:49 UTC\n```\n\nYou can set the environment variable `TZ` to check other locations:\n\n```sh\n$ TZ=\"Africa/Luanda\" sun\nSun rises 04:42, sets 17:18 UTC\n```\n\nFor more precision, you can of course provide your exact latitude and\nlongitude.  See the built-in usage text for more help: `sun -h`\n\n\nCron\n----\n\nTo launch applications at sunrise/sunset using cron, simply:\n\n```sh\n$ crontab -e\n01 00 * * * sun -r -w -o -30m; play english.au\n```\n\nThis plays Linus Torvalds' classic audio file 30 minutes before sunrise.\n\n**NOTE:** You may want to set the `$PATH` in your crontab, or use an\n  absolute path to your programs, otherwise cron will not find them.\n\n\nUsage\n-----\n\n```\nUsage:\n  sun [-ahirsw] [-o OFFSET] [+/-latitude +/-longitude]\n\nOptions:\n  -a      Show all relevant times and exit\n  -l      Increased verbosity, enable log messages\n  -h      This help text\n  -i      Interactive mode\n  -r      Sunrise mode\n  -s      Sunset mode\n  -u      Use UTC everywhere, not local time\n  -v      Show program version and exit\n  -w      Wait until sunset or sunrise\n  -o ARG  Time offset to adjust wait, e.g. -o -30m\n          maximum allowed offset: +/- 6h\n\nBug report address: https://github.com/troglobit/sun/issues\n```\n\n\nGoal\n----\n\nThe goal of this project is to provide just enough intelligence to\nmy home automation system so it can control the indoor lights, which\nare operated using 433 MHz outlet switches.\n\n\nBuilding\n--------\n\nThe `sun` is built with the GNU configure and build system.  Simply run\nthe following commands to build and install:\n\n```sh\n$ ./configure\n$ make\n$ sudo make install\n```\n\nThe `sunriset.c` code can be built as a library, use `--enable-library`\nwith the configure script to enable this optional feature.\n\nIf you built from GIT, or have modified any of the `.ac` or `.am` files,\nyou have to run the following to (re-)create the configure script:\n\n```sh\n.$ /autogen.sh\n```\n\nFor that to work you need to have `autoconf`, `automake`, and `libtool`\ninstalled.  These tools are not needed when building from an official\nreleased tarball.\n\n\n\n[Paul Schlyter]: http://stjarnhimlen.se/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroglobit%2Fsun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftroglobit%2Fsun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroglobit%2Fsun/lists"}