Go to file
Kenny Levinsen b9f0b8e3c0 Move longitude time correction out of calc_sun
calc_sun reported sun trajectory in seconds since the start of a UTC
day, as they would occur for the specified UTC day. The caller would
then add the UTC timestamp for the start of a UTC day to these numbers.
This lead to complications, as e.g. a sunrise in China would be a
negative value, as it occurred in the last UTC day.

Futhermore, the start of a UTC day was used to signal the need for new
sun calculations. This would lead to recalculations to possibly occur
after its results were needed, such as after sunrise when the target
longitude deviated significantly from the prime meridian.

To fix this, we apply longitude time correction to the start of day
calculation. This way recalculation will occur on the start of the
longitude local day, close midnight for the observer.

We also remove the longitude time correction from calc_sun, so that it
simply returning the number of seconds since the start of the local day
of the observer. The caller then adds the start of the longitude local
day to get the final numbers.
2020-10-19 14:18:28 +02:00
.build.yml ci: Build on alpine 2020-09-13 22:07:19 +02:00
LICENSE Add license 2020-09-12 20:56:26 +02:00
README.md readme: Add IRC and mailing list note 2020-09-20 03:54:16 +02:00
color_math.c Move longitude time correction out of calc_sun 2020-10-19 14:18:28 +02:00
color_math.h Move longitude time correction out of calc_sun 2020-10-19 14:18:28 +02:00
main.c Move longitude time correction out of calc_sun 2020-10-19 14:18:28 +02:00
meson.build Perform absolute sleeps 2020-10-04 19:49:45 +02:00
wlr-gamma-control-unstable-v1.xml Initial commit 2020-09-12 20:13:28 +02:00

README.md

wlsunset

Day/night gamma adjustments for Wayland compositors supporting wlr-gamma-control-unstable-v1.

How to build and install

meson build
ninja -C build
sudo ninja -C build install

How to use

See the helptext (wlsunset -h)

Example

# Beijing lat/long.
wlsunset -l 39.9 -L 116.3

Greater precision than one decimal place serves no purpose other than padding the command-line.

Help

Go to #kennylevinsen @ chat.freenode.net to discuss, or use ~kennylevinsen/public-inbox@lists.sr.ht