ok this time for sure

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
2016-09-28 23:30:07 +03:00
parent c477498102
commit c1ffc8cb6c
7 changed files with 42 additions and 59 deletions

View File

@@ -1,24 +1,19 @@
# vim: ft=ruby
class ModBspwmTaskbar < ModBasic
@@mod_name = 'bspwm_taskbar'
def data_loop()
class BspwmTaskbar < Worker
def mainloop()
while true do
pipe = IO.popen("xtitle -s -f '%s'")
$children << pipe.pid
pipe.each do |line|
if line == "\n"
$panel_data[@@mod_name.to_sym] = ""
self.write ""
else
$panel_data[@@mod_name.to_sym] = $config['mod']['bspwm_taskbar']['begin'].erb + line.chomp + $config['mod']['bspwm_taskbar']['end'].erb
self.write @config['mod']['bspwm_taskbar']['begin'].erb + line.chomp + @config['mod']['bspwm_taskbar']['end'].erb + "\n"
end
$queue << 1
end
end
end
end
ModBspwmTaskbar.new.mainloop()
Modules.add("bspwm_taskbar", "BspwmTaskbar")