night light is checking every second during the daytime
I have G_MESSAGES_DEBUG=all
set and I noticed this kind of thing repeating all the time in my journal:
Aug 15 11:57:11 nightingale gsd-color[4823]: fractional day = 11.953, limits = 20.556->5.753
Aug 15 11:57:11 nightingale gsd-color[4823]: not time for night-light
Aug 15 11:57:12 nightingale gsd-color[4823]: fractional day = 11.953, limits = 20.556->5.753
Aug 15 11:57:12 nightingale gsd-color[4823]: not time for night-light
Aug 15 11:57:13 nightingale gsd-color[4823]: fractional day = 11.954, limits = 20.556->5.753
Aug 15 11:57:13 nightingale gsd-color[4823]: not time for night-light
Aug 15 11:57:14 nightingale gsd-color[4823]: fractional day = 11.954, limits = 20.556->5.753
Aug 15 11:57:14 nightingale gsd-color[4823]: not time for night-light
Aug 15 11:57:15 nightingale gsd-color[4823]: fractional day = 11.954, limits = 20.556->5.753
Aug 15 11:57:15 nightingale gsd-color[4823]: not time for night-light
Aug 15 11:57:16 nightingale gsd-color[4823]: fractional day = 11.954, limits = 20.556->5.753
Aug 15 11:57:16 nightingale gsd-color[4823]: not time for night-light
Aug 15 11:57:17 nightingale gsd-color[4823]: fractional day = 11.955, limits = 20.556->5.753
Aug 15 11:57:17 nightingale gsd-color[4823]: not time for night-light
Aug 15 11:57:18 nightingale gsd-color[4823]: fractional day = 11.955, limits = 20.556->5.753
Aug 15 11:57:18 nightingale gsd-color[4823]: not time for night-light
Firstly, the g_timeout_add_seconds
is given a value of 5 seconds, so I'm not sure why this is happening every second.
But mainly - shouldn't it be possible to calculate the time we are planning to start the night light at and wait for that time instead of re-checking every n seconds? If relevant settings - like the timezone or night light's own settings - change, then the timeout would need to be re-calculated, of course.