Files
moltenbar/mod/bspwm_taskbar
T

21 lines
385 B
Ruby
Raw Normal View History

2016-09-27 11:13:42 +03:00
# vim: ft=ruby
2016-09-28 23:30:07 +03:00
class BspwmTaskbar < Worker
def mainloop()
2016-09-27 11:13:42 +03:00
while true do
2016-09-27 13:03:14 +03:00
pipe = IO.popen("xtitle -s -f '%s'")
pipe.each do |line|
if line == "\n"
2016-09-28 23:30:07 +03:00
self.write ""
2016-09-27 13:03:14 +03:00
else
2016-10-04 15:34:25 +03:00
tmpl = Template.new(@my_config['begin'] + line.chomp + @my_config['end'])
2016-09-29 15:27:42 +03:00
self.write tmpl.render(@config, nil)
2016-09-27 13:03:14 +03:00
end
2016-09-27 11:13:42 +03:00
end
end
end
end
2016-09-28 23:30:07 +03:00
Modules.add("bspwm_taskbar", "BspwmTaskbar")