From a1ea9b3dd67a57ad918794d1f2af98f3c1747591 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 26 Apr 2014 23:21:34 +0200 Subject: add brightness to x-window-focus example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/x-window-focus | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/x-window-focus b/examples/x-window-focus index 81e75d9..5176645 100644 --- a/examples/x-window-focus +++ b/examples/x-window-focus @@ -36,9 +36,12 @@ monitors = [0, 1] gammas = [[1.16, 1.15, 1.11], [1.10, 1.16, 1.10]] -# The colour temperature for normal programs +# The colour temperature for normal applications standard_temperature = 3500 +# The brightness for normal applications +standard_brightness = 0.8 + # Acquire connection to X x_display = Xlib.display.Display() # Get root windows for each screen and list on most events @@ -157,14 +160,19 @@ def periodically(year, month, day, hour, minute, second, weekday, fade): for monitor in range(len(monitors)): start_over() temp = standard_temperature + bright = standard_brightness if window[0] in ('Dooble', 'claws-mail'): temp = 2000 + bright = 0.5 elif window[0] == 'inkscape': temp = 6500 + bright = 1.0 elif window[0].startswith('gimp-'): # continues with the version number temp = 6500 + bright = 1.0 + cie_brightness(bright) temperature(temp, lambda t : clip_whitepoint(divide_by_maximum(cmf_10deg(t)))) gamma(*gammas[monitor]) randr(monitors[monitor]) -- cgit v1.2.3-70-g09d2