summaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authoremersion <[email protected]>2018-06-07 19:29:26 +0100
committerGitHub <[email protected]>2018-06-07 19:29:26 +0100
commit07bee8cffe60b4a23ddd637461d8290f25f99be2 (patch)
treee3174539676a876ee882e72af579ba9e63e468e6 /sway/commands.c
parent2e289831ee3198f36e2c02bd4542fa4f6646a81b (diff)
parentf4870d5432b9d90865fee177465ff9cf22fab51c (diff)
Merge pull request #2084 from RedSoxFan/runtime-var-expansion
Runtime variable expansion
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 3a86ae53..464c9932 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -112,6 +112,7 @@ static struct cmd_handler handlers[] = {
{ "mouse_warping", cmd_mouse_warping },
{ "output", cmd_output },
{ "seat", cmd_seat },
+ { "set", cmd_set },
{ "show_marks", cmd_show_marks },
{ "workspace", cmd_workspace },
{ "workspace_auto_back_and_forth", cmd_ws_auto_back_and_forth },
@@ -120,7 +121,6 @@ static struct cmd_handler handlers[] = {
/* Config-time only commands. Keep alphabetized */
static struct cmd_handler config_handlers[] = {
{ "default_orientation", cmd_default_orientation },
- { "set", cmd_set },
{ "swaybg_command", cmd_swaybg_command },
{ "workspace_layout", cmd_workspace_layout },
};
@@ -270,6 +270,13 @@ struct cmd_results *execute_command(char *_exec, struct sway_seat *seat) {
goto cleanup;
}
+ // Var replacement, for all but first argument of set
+ for (int i = handler->handle == cmd_set ? 2 : 1; i < argc; ++i) {
+ argv[i] = do_var_replacement(argv[i]);
+ unescape_string(argv[i]);
+ strip_quotes(argv[i]);
+ }
+
if (!config->handler_context.using_criteria) {
// without criteria, the command acts upon the focused
// container