diff options
author | Ronan Pigott <ronan@rjp.ie> | 2022-11-18 20:05:24 -0700 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-11-26 09:48:58 +0100 |
commit | 30ad4dc4a5a41ce7c7aa85096a6e18f374172983 (patch) | |
tree | 9b88b2c72174819ddc7f59b6cda52d28014986d7 /sway/commands | |
parent | bdeb9f95651f6c99cc2f4cfb59020ddee202cf36 (diff) |
launcher: export xdga tokens and use them for workspace matching
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/exec_always.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index 13deb9e3..2dfba7ff 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c @@ -27,6 +27,11 @@ struct cmd_results *cmd_exec_validate(int argc, char **argv) { return error; } +static void export_xdga_token(struct launcher_ctx *ctx) { + const char *token = launcher_ctx_get_token_name(ctx); + setenv("XDG_ACTIVATION_TOKEN", token, 1); +} + struct cmd_results *cmd_exec_process(int argc, char **argv) { struct cmd_results *error = NULL; char *cmd = NULL; @@ -66,6 +71,9 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) { close(fd[0]); if ((child = fork()) == 0) { close(fd[1]); + if (ctx) { + export_xdga_token(ctx); + } execlp("sh", "sh", "-c", cmd, (void *)NULL); sway_log_errno(SWAY_ERROR, "execlp failed"); _exit(1); |