From c8bdda790e1fc428b16a16515b4cb4910239de48 Mon Sep 17 00:00:00 2001 From: James Reed Date: Wed, 8 May 2019 16:01:36 -0600 Subject: [PATCH] Add support for wm-launch's firejail flag --- init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.lua b/init.lua index 1f1e913..fb5090d 100644 --- a/init.lua +++ b/init.lua @@ -84,6 +84,7 @@ end -- @param args.timeout Seconds after which to stop waiting for a client to spawn. -- @param args.callback Function to call with client when it spawns. -- @param args.factory The factory to use (see wm-launch's -f flag). +-- @param args.firejail If true, run cmd with firejail. -- @return The client's ID. -- @function launch.spawn local function spawn(cmd, args) @@ -113,6 +114,10 @@ local function spawn(cmd, args) launch = launch .. " -f " .. args.factory end + if args.firejail then + launch = launch .. " -j" + end + launch = string.format("%s %s %s", launch, id, cmd) if data.pwd then @@ -141,6 +146,7 @@ setmetatable(launch.spawn, {__call = function (_, ...) spawn(...) end}) -- @param args.timeout Seconds after which to stop waiting for a client to spawn. -- @param args.callback Function to call with client when it spawns. -- @param args.factory The factory to use (see wm-launch's -f flag). +-- @param args.firejail If true, run cmd with firejail. -- @param args.filter Function to filter clients that are considered. -- @return The client's ID. -- @function spawn.single_instance @@ -165,6 +171,7 @@ end -- @param args.timeout Seconds after which to stop waiting for a client to spawn. -- @param args.callback Function to call with client when it spawns. -- @param args.factory The factory to use (see wm-launch's -f flag). +-- @param args.firejail If true, run cmd with firejail. -- @param args.filter Function to filter clients that are considered. -- @return The client's ID. -- @function spawn.raise_or_spawn