@@ -4,14 +4,10 @@ class BspwmPager < Worker
 | 
			
		||||
	def mainloop()
 | 
			
		||||
		IO.popen("bspc subscribe") do |pipe|
 | 
			
		||||
			pipe.each do |line|
 | 
			
		||||
				monitor = line.split(":")[0]
 | 
			
		||||
 | 
			
		||||
				if @my_config.has_key?("monitors") == false || @my_config['monitors'].include?(monitor)
 | 
			
		||||
				self.write parse_data(line)
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	def parse_data(string)
 | 
			
		||||
		# Example: WMDVI-I-1:o1:o2:f3:f4:O5:f6:f7:f8:f9:fh:LT:TF:G
 | 
			
		||||
@@ -42,18 +38,14 @@ class BspwmPager < Worker
 | 
			
		||||
						out << " #{n} "
 | 
			
		||||
					end
 | 
			
		||||
				when /^L.+/
 | 
			
		||||
					@layout = n
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
 | 
			
		||||
		case @layout
 | 
			
		||||
					case n
 | 
			
		||||
						when "T"
 | 
			
		||||
				layout_flag = "t"
 | 
			
		||||
							out << " t "
 | 
			
		||||
						when "M"
 | 
			
		||||
				layout_flag = "m"
 | 
			
		||||
							out << " m "
 | 
			
		||||
					end
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
 | 
			
		||||
		out << " #{layout_flag} "
 | 
			
		||||
 | 
			
		||||
		return out.join.chomp
 | 
			
		||||
	end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user