reworked generate_text() and fixed spacing bug
This commit is contained in:
		
							parent
							
								
									cde7b1af0d
								
							
						
					
					
						commit
						71bfac1b53
					
				
					 1 changed files with 5 additions and 6 deletions
				
			
		|  | @ -84,12 +84,11 @@ class Module: | ||||||
|                     self.post += "%{A}" |                     self.post += "%{A}" | ||||||
|              |              | ||||||
|     def generate_text(self): |     def generate_text(self): | ||||||
|         text = self.pre + self.padding + self.prefix |         command_output = run(self.command, shell=True, capture_output=True, text=True).stdout.strip() | ||||||
|         if self.signal != 0: |         if len(command_output) == 0: | ||||||
|             text += "(" + str(self.signal) + ")" |             self.text = "" | ||||||
|         text += run(self.command, shell=True, capture_output=True, text=True).stdout.strip() |         else: | ||||||
|         text += self.padding + self.post |             self.text = self.pre + self.padding + self.prefix + command_output + self.padding + self.post | ||||||
|         self.text = text |  | ||||||
|      |      | ||||||
|     def thread_callback(self): |     def thread_callback(self): | ||||||
|         while True: |         while True: | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue