From 5f5c3ecf1999b5f2a70e1368c3efe90c34a4b166 Mon Sep 17 00:00:00 2001 From: gotno Date: Sat, 12 Apr 2014 17:31:58 -0700 Subject: [PATCH 1/2] 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. --- init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 3fbe399..f1ab6d5 100755 --- a/init.lua +++ b/init.lua @@ -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 From b44b436fb023f3b552c1b0b0ba7de14084ea1ab3 Mon Sep 17 00:00:00 2001 From: gotno Date: Sat, 12 Apr 2014 17:45:48 -0700 Subject: [PATCH 2/2] remove unused code --- init.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/init.lua b/init.lua index f1ab6d5..9d00e2b 100755 --- a/init.lua +++ b/init.lua @@ -28,8 +28,6 @@ local function on_selected_change(tag,data) 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 end end