From 0f0bd3eb61c2bce9ac0745c57bde80f70c6f9cdb Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 19 Jul 2017 13:01:48 -0400 Subject: [PATCH] launch commands in the background instead of foreground with tide-fetch --- tide-fetch.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tide-fetch.rb b/tide-fetch.rb index a92ea66..add4271 100755 --- a/tide-fetch.rb +++ b/tide-fetch.rb @@ -27,14 +27,19 @@ def match(regex) end end +def spawn(cmd) + job = fork { exec cmd } + Process.detach(job) +end + def open_file - system("xdg-open #{$item}") + spawn("xdg-open #{$item}") end def open_with(app) app = Apps[app] || ENV[app.to_s.upcase] raise RuleError.new() if not app - system("#{app} #{$item}") + spawn("#{app} #{$item}") end def find_files(file) -- 2.49.0