spawn: Use awful.spawn.single_instance.

While it has limitations on process that "fork" themselves
and don't support startup notifications. It is more reliable
for everything else.
This commit is contained in:
Emmanuel Lepage Vallee 2019-02-03 12:03:03 -05:00
parent 38f1f60879
commit 0ba21a99e5
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ local module,c_rules,tags_hash,settings,fallbacks = {},{class={},instance={}},{}
local function on_selected_change(tag,data)
if data and data.exec_once and tag.selected then
for _,v in ipairs(type(data.exec_once) == "string" and {data.exec_once} or data.exec_once) do
awful.spawn.with_shell("ps -ef | grep -v grep | grep '" .. v .. "' > /dev/null || (" .. v .. ")")
awful.spawn.single_instance(v)
end
end
end