summaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorLuminarys <[email protected]>2015-08-10 19:50:22 -0500
committerLuminarys <[email protected]>2015-08-11 12:48:55 -0500
commita5b02791d43cc68cc9686266f725be0fea7072fa (patch)
treedaa3849d3a225b31c9ad246fff0dbdeed25ee2ca /sway/commands.c
parent803a4739b61ef71204d58bb5464b9a2ebd57cf36 (diff)
Changed command handler to perform var subs on all cmd args
Fixed workspace_next_name to use the first workspace name it can find in the config Minor fixes Changed command handler to perform var subs on all portions of a command Revert "Changed command handler to perform var subs on all portions of a command" This reverts commit fcfcffa1ea9819bcada6e6c85b40b21bf1b3a96e. Var sub fixes Minor fixes More minor fixes
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index be9984e3..870a2377 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -34,7 +34,6 @@ bool cmd_bindsym(struct sway_config *config, int argc, char **argv) {
sway_log(L_ERROR, "Invalid set command (expected 2 arguments, got %d)", argc);
return false;
}
- argv[0] = do_var_replacement(config, argv[0]);
struct sway_binding *binding = malloc(sizeof(struct sway_binding));
binding->keys = create_list();
@@ -381,6 +380,12 @@ bool handle_command(struct sway_config *config, char *exec) {
int argc;
char **argv = split_directive(exec + strlen(handler->command), &argc);
int i;
+
+ //Perform var subs on all parts of the command
+ for (i = 0; i < argc; ++i) {
+ argv[i] = do_var_replacement(config, argv[i]);
+ }
+
exec_success = handler->handle(config, argc, argv);
for (i = 0; i < argc; ++i) {
free(argv[i]);