| 
									
										
										
										
											2016-09-27 11:13:42 +03:00
										 |  |  | # vim: ft=ruby | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ModBspwmTaskbar < ModBasic | 
					
						
							|  |  |  | 	@@mod_name = 'bspwm_taskbar' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	def data_loop() | 
					
						
							|  |  |  | 		while true do | 
					
						
							| 
									
										
										
										
											2016-09-27 13:03:14 +03:00
										 |  |  | 			pipe = IO.popen("xtitle -s -f '%s'") | 
					
						
							|  |  |  | 			$children << pipe.pid | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			pipe.each do |line| | 
					
						
							|  |  |  | 				if line == "\n" | 
					
						
							|  |  |  | 					$panel_data[@@mod_name.to_sym] = "" | 
					
						
							|  |  |  | 				else | 
					
						
							|  |  |  | 					$panel_data[@@mod_name.to_sym] = $config['mod']['bspwm_taskbar']['begin'].erb + line.chomp + $config['mod']['bspwm_taskbar']['end'].erb | 
					
						
							|  |  |  | 				end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-27 11:13:42 +03:00
										 |  |  | 				$queue << 1 | 
					
						
							|  |  |  | 			end | 
					
						
							|  |  |  | 		end | 
					
						
							|  |  |  | 	end | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ModBspwmTaskbar.new.mainloop() |