File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,9 @@ def __init__(self, args=[]):
52
52
self ._period = 'Unknown'
53
53
self ._location = (0.0 , 0.0 )
54
54
55
- # Install TERM signal handler
55
+ # Install TERM/INT signal handler
56
56
signal .signal (signal .SIGTERM , sigterm_handler )
57
+ signal .signal (signal .SIGINT , sigterm_handler )
57
58
58
59
# Start redshift with arguments
59
60
args .insert (0 , os .path .join (defs .BINDIR , 'redshift' ))
@@ -183,6 +184,12 @@ class InputBuffer(object):
183
184
GLib .io_add_watch (self .process [3 ], GLib .PRIORITY_DEFAULT , GLib .IO_IN ,
184
185
self .child_data_cb , (False , self .error_buffer ))
185
186
187
+ # Signal handler to relay USR1 signal to redshift process
188
+ def relay_signal_handler (signal , frame ):
189
+ os .kill (self .process [0 ], signal )
190
+
191
+ signal .signal (signal .SIGUSR1 , relay_signal_handler )
192
+
186
193
# Notify desktop that startup is complete
187
194
Gdk .notify_startup_complete ()
188
195
You can’t perform that action at this time.
0 commit comments