Merge pull request #35 from gotno/exec_once
Replace the old exec_once logic with a more useful one
This commit is contained in:
commit
117bf645dd
7
init.lua
7
init.lua
|
@ -24,11 +24,10 @@ end
|
||||||
|
|
||||||
--Called when a tag is selected/unselected
|
--Called when a tag is selected/unselected
|
||||||
local function on_selected_change(tag,data)
|
local function on_selected_change(tag,data)
|
||||||
if data and data.exec_once and tag.selected and not data._init_done then
|
if data and data.exec_once and tag.selected then
|
||||||
for k,v in ipairs(type(data.exec_once) == "string" and {data.exec_once} or data.exec_once) do
|
for _,v in ipairs(type(data.exec_once) == "string" and {data.exec_once} or data.exec_once) do
|
||||||
awful.util.spawn(v, false)
|
awful.util.spawn_with_shell("ps -ef | grep -v grep | grep '" .. v .. "' > /dev/null || (" .. v .. ")")
|
||||||
end
|
end
|
||||||
data._init_done = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue