REFACTORING
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
8332f8a49f
commit
4d2b7b1f9c
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
class BspwmPager < Worker
|
class BspwmPager < Worker
|
||||||
def mainloop()
|
def mainloop()
|
||||||
while true do
|
IO.popen("bspc subscribe") do
|
||||||
pipe = IO.popen("bspc subscribe")
|
|pipe|
|
||||||
|
|
||||||
pipe.each do |line|
|
pipe.each do |line|
|
||||||
monitor = line.split(":")[0]
|
monitor = line.split(":")[0]
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
class BspwmTaskbar < Worker
|
class BspwmTaskbar < Worker
|
||||||
def mainloop()
|
def mainloop()
|
||||||
while true do
|
IO.popen("xtitle -s -f '%s'") do |pipe|
|
||||||
pipe = IO.popen("xtitle -s -f '%s'")
|
|
||||||
|
|
||||||
pipe.each do |line|
|
pipe.each do |line|
|
||||||
if line == "\n"
|
if line == "\n"
|
||||||
self.write ""
|
self.write ""
|
||||||
|
|
|
@ -16,7 +16,7 @@ class Network < Worker
|
||||||
hosts = @my_config['hosts']
|
hosts = @my_config['hosts']
|
||||||
|
|
||||||
net_fail = 0
|
net_fail = 0
|
||||||
Open3.popen2("fping", *hosts) {|i,o,t|
|
Open3.popen2("fping", *hosts) do |i,o,t|
|
||||||
net_ok = o.each_line.count
|
net_ok = o.each_line.count
|
||||||
|
|
||||||
if net_ok == hosts.count
|
if net_ok == hosts.count
|
||||||
|
@ -31,7 +31,7 @@ class Network < Worker
|
||||||
end
|
end
|
||||||
|
|
||||||
@rstr = "%{F#{fg_colour}}#{status}%{F-}"
|
@rstr = "%{F#{fg_colour}}#{status}%{F-}"
|
||||||
}
|
end
|
||||||
|
|
||||||
return @rstr
|
return @rstr
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user