aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/exec_always.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c
index 2dfba7ff..e6b09e64 100644
--- a/sway/commands/exec_always.c
+++ b/sway/commands/exec_always.c
@@ -32,11 +32,17 @@ static void export_xdga_token(struct launcher_ctx *ctx) {
setenv("XDG_ACTIVATION_TOKEN", token, 1);
}
+static void export_startup_id(struct launcher_ctx *ctx) {
+ const char *token = launcher_ctx_get_token_name(ctx);
+ setenv("DESKTOP_STARTUP_ID", token, 1);
+}
+
struct cmd_results *cmd_exec_process(int argc, char **argv) {
struct cmd_results *error = NULL;
char *cmd = NULL;
+ bool no_startup_id = false;
if (strcmp(argv[0], "--no-startup-id") == 0) {
- sway_log(SWAY_INFO, "exec switch '--no-startup-id' not supported, ignored.");
+ no_startup_id = true;
--argc; ++argv;
if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) {
return error;
@@ -74,6 +80,9 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) {
if (ctx) {
export_xdga_token(ctx);
}
+ if (ctx && !no_startup_id) {
+ export_startup_id(ctx);
+ }
execlp("sh", "sh", "-c", cmd, (void *)NULL);
sway_log_errno(SWAY_ERROR, "execlp failed");
_exit(1);