run commands that lemonbar outputs
This commit is contained in:
parent
699fb758c9
commit
8811476f9f
21
moltenbar
21
moltenbar
|
@ -48,6 +48,19 @@ class Worker
|
|||
end
|
||||
end
|
||||
|
||||
class DoSystem < Worker
|
||||
def initialize(name, pipe)
|
||||
@name = name
|
||||
@pipe = pipe
|
||||
end
|
||||
|
||||
def mainloop()
|
||||
@pipe.each do |cmd|
|
||||
system(cmd)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class ::String
|
||||
def erb
|
||||
return ERB.new(self).result
|
||||
|
@ -143,11 +156,9 @@ puts "Launching lemonbar as: " + lemonbar_cmd.join(" ")
|
|||
IO.popen(lemonbar_cmd, "w+") do |pipe_lb|
|
||||
pipe_lb.sync = true
|
||||
|
||||
fork do
|
||||
pipe_lb.each do |line|
|
||||
system(line)
|
||||
end
|
||||
end
|
||||
sys = DoSystem.new("system", pipe_lb)
|
||||
workers << sys
|
||||
sys.run()
|
||||
|
||||
pipe_r.each do |line|
|
||||
mod_name, data = line.chomp.split("\0")
|
||||
|
|
Loading…
Reference in New Issue
Block a user