From 61cf1cbfcc40c8638e57af6d8ae058e1a6b59c71 Mon Sep 17 00:00:00 2001 From: Bart Trojanowski Date: Mon, 11 May 2009 23:28:48 -0400 Subject: [PATCH] fix alt-p when wmiir setsid is available --- src/core/wmii.lua.in | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/core/wmii.lua.in b/src/core/wmii.lua.in index fa3db6a..7950a96 100644 --- a/src/core/wmii.lua.in +++ b/src/core/wmii.lua.in @@ -273,6 +273,25 @@ end --[[ =pod +=item shell_execute ( cmd ) + +setsid wrapper for os.execute(c) +like execute() but runs under a subshell + +=cut +--]] +function shell_execute (cmd) + cmd = cmd:gsub('([\\"])', '\\%1') + cmd = 'sh -c "' .. cmd .. '"' + + return execute(cmd) +end + + + +--[[ +=pod + =item find_wmiirc ( ) Locates the wmiirc script. It looks in %HOME_WMII% and %RC_DIR% @@ -499,7 +518,7 @@ function prog_menu () local cmd = "(" .. table.concat(hstt) .. "dmenu_path ) |" .. table.concat(menu," ") - execute (cmd) + shell_execute (cmd) local fh = io.open (outfile, "rb") os.remove (outfile) -- 2.11.4.GIT