From 23919685c7321e073376b8ba5a6c596fdb9fd3b9 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 22 Feb 2014 13:09:39 +0100 Subject: support C-c in one shot mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/__main__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/__main__.py') diff --git a/src/__main__.py b/src/__main__.py index f803824..27c025e 100755 --- a/src/__main__.py +++ b/src/__main__.py @@ -419,7 +419,10 @@ if (config_file is None) and any([doreset, location] + settings): while running: apply(alpha(), trans if doreset else 1 - trans) trans += 0.05 - time.sleep(0.1) + try: + time.sleep(0.1) + except KeyboardInterrupt: + signal_SIGTERM(0, None) if trans >= 1: break apply(alpha(), 1 if doreset else 0) -- cgit v1.2.3-70-g09d2