From 995d080cb9608d0715c1773a9da011f7a5740da3 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 20 Sep 2022 17:34:44 +0300 Subject: [PATCH] compositor/main: Extract split/retrieve args passed shell client The supplied path for executing the shell client could contain potential arguments and not only the binary itself. Specifying the platform either by using an argument (-platform wayland) or using an environmental variable (QT_QPA_PLATFORM) with clients written in Qt is for instance an example on why this might be useful to have in. Signed-off-by: Marius Vlad --- compositor/main.c | 2 +- man/weston.ini.man | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/compositor/main.c b/compositor/main.c index 2eb0a03c..e90336ef 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -390,7 +390,7 @@ weston_client_launch(struct weston_compositor *compositor, str_printf(&fail_exec, "Error: Couldn't launch client '%s'\n", path); custom_env_init_from_environ(&child_env); - custom_env_add_arg(&child_env, path); + custom_env_add_from_exec_string(&child_env, path); if (os_socketpair_cloexec(AF_UNIX, SOCK_STREAM, 0, wayland_socket.fds) < 0) { diff --git a/man/weston.ini.man b/man/weston.ini.man index 179e0882..24f2138b 100644 --- a/man/weston.ini.man +++ b/man/weston.ini.man @@ -333,8 +333,12 @@ different shell plugins. .PP The entries that can appear in this section are: .TP 7 -.BI "client=" file -sets the path for the shell client to run. If not specified +.BI "client=" "@weston_libexecdir@/@weston_shell_client@" +specifies the path for the shell client to run. +It is possible to pass arguments and environment variables to the program, +for example, 'ENVFOO=bar ENVBAR=baz /path/to/program --arg anotherarg', +with entries that are space-separated but with no support for quoting. +If no client was specified then .I @weston_shell_client@ is launched (string). .TP 7 @@ -574,6 +578,10 @@ section with the key .TP 7 .BI "path=" "@weston_libexecdir@/weston-keyboard" sets the path of the on screen keyboard input method (string). +It is possible to pass arguments and environment variables to the program, +for example, 'ENVFOO=bar ENVBAR=baz /path/to/program --arg anotherarg', +with entries that are space-separated but with no support for quoting. + .TP 7 .BI "overlay-keyboard=" false sets weston-keyboard as overlay panel.