Restore shifty-like functionality to exec_once

exec_once always runs if the command isn't already running, regardless
of whether it's been run before in this session.
This commit is contained in:
gotno 2014-04-12 17:31:58 -07:00
parent fb2ed202af
commit 5f5c3ecf19
1 changed files with 5 additions and 4 deletions

View File

@ -24,11 +24,12 @@ end
--Called when a tag is selected/unselected
local function on_selected_change(tag,data)
if data and data.exec_once and tag.selected and not data._init_done then
for k,v in ipairs(type(data.exec_once) == "string" and {data.exec_once} or data.exec_once) do
awful.util.spawn(v, false)
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.util.spawn_with_shell("ps -ef | grep -v grep | grep '" .. v .. "' > /dev/null || (" .. v .. ")")
end
data._init_done = true
--data._init_done = true
end
end