Compare commits
	
		
			2 commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 9db20eb942 | |||
| 7ad72a2914 | 
					 2 changed files with 6 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -71,7 +71,9 @@ signal to listen for, e.g.
 | 
			
		|||
 | 
			
		||||
In the example above, the refresh is `0`. This means that the module *will never
 | 
			
		||||
refresh on its own*; it will wait for the RTMIN+1 signal. You may also configure
 | 
			
		||||
your module to both refresh on a time interval AND listen for a signal.
 | 
			
		||||
your module to both refresh on a time interval AND listen for a signal. Also
 | 
			
		||||
note: multiple modules may listen for the same signal. They will all be
 | 
			
		||||
refreshed when the signal is recieved.
 | 
			
		||||
 | 
			
		||||
Unfortunately, to send the signal, you cant just `pkill easyconf-lemonbar`. You
 | 
			
		||||
have to read the PID from eclb's pidfile. I would recommend creating an alias in
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,8 +6,9 @@ class SignalRouter:
 | 
			
		|||
        self.signal_thread_dictionary = {}
 | 
			
		||||
 | 
			
		||||
    def __route_signal(self, signal, frame):
 | 
			
		||||
        pthread_kill(self.signal_thread_dictionary[signal], signal)
 | 
			
		||||
        for thread_ident in self.signal_thread_dictionary[signal]:
 | 
			
		||||
            pthread_kill(thread_ident, signal)
 | 
			
		||||
 | 
			
		||||
    def register_signal_thread(self, signal, thread_ident):
 | 
			
		||||
        self.signal_thread_dictionary[signal] = thread_ident
 | 
			
		||||
        self.signal_thread_dictionary.setdefault(signal, []).append(thread_ident)
 | 
			
		||||
        sigsignal(signal, self.__route_signal)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue