From 79fd402d820e88f7ca75ab6b568d428c57e2fae4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 4 Mar 2014 17:33:20 +0100 Subject: add -r support for one shot mode in comprehensive example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- TODO | 1 - examples/comprehensive | 23 +++++++++++++++-------- src/__main__.py | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index 55e6423..742cc66 100644 --- a/TODO +++ b/TODO @@ -3,7 +3,6 @@ High priority: unless we have stored settings handled by the configuration script that are correct Medium priority: - -r support in the comperhensive example Finish support for EDID Low priority: diff --git a/examples/comprehensive b/examples/comprehensive index b055a76..ce6adbf 100644 --- a/examples/comprehensive +++ b/examples/comprehensive @@ -6,7 +6,7 @@ # sigmoid correction, or free function modifier. Neither does it # support multiple screens, this is normally not an issue because # Xinerama is normally used to put all monitors on the same screen; -# nor does it parse ad-hoc settings or configuration options, or +# nor does it parse options other than -r from ad-hoc settigns, or # use monitor identifiation. @@ -132,8 +132,8 @@ icc_calibration_profile = [None] # -p (--panicgate) is used. current_calibration = [None] if not panicgate: - #calib_get = None - calib_get = randr_get + calib_get = None + #calib_get = randr_get #calib_get = vidmode_get current_calibration = [calib_get] @@ -184,12 +184,16 @@ monitor_controller = lambda : randr(*monitors) ''' -uses_adhoc_opts = False +uses_adhoc_opts = True ''' -:bool `True` if the configuration screens parses the ad-hoc settings +:bool `True` if the configuration script parses the ad-hoc settings ''' +# Get --reset from Blueshift ad-hoc settigns +doreset = parser.opts['--reset'] + + last_dayness = None def periodically(year, month, day, hour, minute, second, weekday, fade): ''' @@ -400,13 +404,16 @@ else: if not panicgate: signal.signal(signal.SIGTERM, signal_SIGTERM) trans = 0 - apply(trans) + apply((1 - trans) if doreset else trans) while running: time.sleep(0.1) if trans >= 1: break trans += 0.05 - apply(trans) - apply(None) + apply((1 - trans) if doreset else trans) + if not doreset: + apply(None) + else: + reset() periodically = None diff --git a/src/__main__.py b/src/__main__.py index 2a2518d..f081811 100755 --- a/src/__main__.py +++ b/src/__main__.py @@ -130,7 +130,7 @@ panic = False uses_adhoc_opts = False ''' -:bool `True` if the configuration screens parses the ad-hoc settings +:bool `True` if the configuration script parses the ad-hoc settings ''' conf_opts = None -- cgit v1.2.3-70-g09d2