REFACTORING

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2016-10-23 02:07:59 +03:00
parent 8332f8a49f
commit 4d2b7b1f9c
3 changed files with 6 additions and 8 deletions

View File

@ -2,8 +2,8 @@
class BspwmPager < Worker
def mainloop()
while true do
pipe = IO.popen("bspc subscribe")
IO.popen("bspc subscribe") do
|pipe|
pipe.each do |line|
monitor = line.split(":")[0]

View File

@ -2,9 +2,7 @@
class BspwmTaskbar < Worker
def mainloop()
while true do
pipe = IO.popen("xtitle -s -f '%s'")
IO.popen("xtitle -s -f '%s'") do |pipe|
pipe.each do |line|
if line == "\n"
self.write ""

View File

@ -16,7 +16,7 @@ class Network < Worker
hosts = @my_config['hosts']
net_fail = 0
Open3.popen2("fping", *hosts) {|i,o,t|
Open3.popen2("fping", *hosts) do |i,o,t|
net_ok = o.each_line.count
if net_ok == hosts.count
@ -31,7 +31,7 @@ class Network < Worker
end
@rstr = "%{F#{fg_colour}}#{status}%{F-}"
}
end
return @rstr
end