From e321246abc2d94bedfb83a13fa967fe424e78d84 Mon Sep 17 00:00:00 2001 From: fbt Date: Mon, 22 May 2017 19:46:44 +0300 Subject: [PATCH] fixes! Signed-off-by: fbt --- mod/bspwm_pager | 6 +++++- mod/bspwm_taskbar | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mod/bspwm_pager b/mod/bspwm_pager index 8201cc8..9b7cda0 100644 --- a/mod/bspwm_pager +++ b/mod/bspwm_pager @@ -17,7 +17,7 @@ class BspwmPager < Worker # Example: WMDVI-I-1:o1:o2:f3:f4:O5:f6:f7:f8:f9:fh:LT:TF:G out = [] - string.split(":").each do |part| + string[1..-1].split(":").each do |part| n = part[1..-1] if @my_config['blacklist'] != nil @@ -27,6 +27,10 @@ class BspwmPager < Worker end case part + when /^M.+/ + out << "%{B#{@config['colours']['mon_focused']}} #{n} %{B-}" + when /^m.+/ + out << " #{n} " when /^(O|F|U).+/ out << "%{B#{@config['colours']['bg_focused']}} #{n} %{B-}" when /^u.+/ diff --git a/mod/bspwm_taskbar b/mod/bspwm_taskbar index ac1581b..a06633f 100644 --- a/mod/bspwm_taskbar +++ b/mod/bspwm_taskbar @@ -2,12 +2,14 @@ class BspwmTaskbar < Worker def mainloop() - IO.popen("xtitle -s -f '%s\n'") do |pipe| + IO.popen("xtitle -s -f '%s'") do |pipe| pipe.each do |line| - if line == "\n" + line.chomp! + + if line == "" self.write "" else - tmpl = Template.new(@my_config['begin'] + line.chomp + @my_config['end']) + tmpl = Template.new(@my_config['begin'] + line + @my_config['end']) self.write tmpl.render(@config, nil) end end