moltenbar/mod/bspwm_taskbar
fbt 4203d6269a hardcoded length limit for bspwm_taskbar
Signed-off-by: fbt <fbt@fleshless.org>
2020-12-03 11:50:11 +03:00

24 lines
361 B
Ruby

# vim: ft=ruby
class BspwmTaskbar < Worker
def mainloop()
IO.popen("xtitle -s -f '%s\n'") do |pipe|
pipe.each do |line|
line.chomp!
if line == ""
line = "desktop"
end
if line.length >= 43
self.write "#{line[0...43]}..."
else
self.write line
end
end
end
end
end
Modules.add("bspwm_taskbar", "BspwmTaskbar")