diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/comprehensive | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/comprehensive b/examples/comprehensive index e1c045e..26abc3c 100644 --- a/examples/comprehensive +++ b/examples/comprehensive @@ -120,6 +120,7 @@ monitor_controller = lambda : randr(*monitors) ''' +last_dayness = None def periodically(year, month, day, hour, minute, second, weekday, fade): ''' :(int, int, int, int, int, int, int, float?)?→void Place holder for periodically invoked function @@ -154,7 +155,12 @@ def periodically(year, month, day, hour, minute, second, weekday, fade): (*) Can be exceeded if the calendar system is changed, like in 1712-(02)Feb-30 (**) See https://en.wikipedia.org/wiki/Leap_second ''' + global last_dayness dayness = get_dayness() + if fade is None: + if dayness == last_dayness: + return + last_dayness = dayness # Help functions for colour interpolation interpol = lambda _day, _night : _day[m % len(_day)] * dayness + _night[m % len(_night)] * (1 - dayness) |