diff options
-rw-r--r-- | sway/commands.c | 7 | ||||
-rw-r--r-- | sway/config.c | 4 | ||||
-rw-r--r-- | sway/main.c | 3 |
3 files changed, 10 insertions, 4 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) { | |||
34 | sway_log(L_ERROR, "Invalid set command (expected 2 arguments, got %d)", argc); | 34 | sway_log(L_ERROR, "Invalid set command (expected 2 arguments, got %d)", argc); |
35 | return false; | 35 | return false; |
36 | } | 36 | } |
37 | argv[0] = do_var_replacement(config, argv[0]); | ||
38 | 37 | ||
39 | struct sway_binding *binding = malloc(sizeof(struct sway_binding)); | 38 | struct sway_binding *binding = malloc(sizeof(struct sway_binding)); |
40 | binding->keys = create_list(); | 39 | binding->keys = create_list(); |
@@ -381,6 +380,12 @@ bool handle_command(struct sway_config *config, char *exec) { | |||
381 | int argc; | 380 | int argc; |
382 | char **argv = split_directive(exec + strlen(handler->command), &argc); | 381 | char **argv = split_directive(exec + strlen(handler->command), &argc); |
383 | int i; | 382 | int i; |
383 | |||
384 | //Perform var subs on all parts of the command | ||
385 | for (i = 0; i < argc; ++i) { | ||
386 | argv[i] = do_var_replacement(config, argv[i]); | ||
387 | } | ||
388 | |||
384 | exec_success = handler->handle(config, argc, argv); | 389 | exec_success = handler->handle(config, argc, argv); |
385 | for (i = 0; i < argc; ++i) { | 390 | for (i = 0; i < argc; ++i) { |
386 | free(argv[i]); | 391 | free(argv[i]); |
diff --git a/sway/config.c b/sway/config.c index a1689f36..6fe681f6 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -8,6 +8,8 @@ | |||
8 | #include "commands.h" | 8 | #include "commands.h" |
9 | #include "config.h" | 9 | #include "config.h" |
10 | 10 | ||
11 | struct sway_config *config; | ||
12 | |||
11 | bool load_config() { | 13 | bool load_config() { |
12 | sway_log(L_INFO, "Loading config"); | 14 | sway_log(L_INFO, "Loading config"); |
13 | // TODO: Allow use of more config file locations | 15 | // TODO: Allow use of more config file locations |
@@ -82,7 +84,7 @@ _continue: | |||
82 | } | 84 | } |
83 | 85 | ||
84 | if (is_active) { | 86 | if (is_active) { |
85 | config->reloading = true; | 87 | config->reloading = false; |
86 | } | 88 | } |
87 | 89 | ||
88 | return config; | 90 | return config; |
diff --git a/sway/main.c b/sway/main.c index f84451de..a7814364 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -7,7 +7,6 @@ | |||
7 | #include "log.h" | 7 | #include "log.h" |
8 | #include "handlers.h" | 8 | #include "handlers.h" |
9 | 9 | ||
10 | struct sway_config *config; | ||
11 | 10 | ||
12 | int main(int argc, char **argv) { | 11 | int main(int argc, char **argv) { |
13 | init_log(L_DEBUG); // TODO: Control this with command line arg | 12 | init_log(L_DEBUG); // TODO: Control this with command line arg |
@@ -42,8 +41,8 @@ int main(int argc, char **argv) { | |||
42 | if (!wlc_init(&interface, argc, argv)) { | 41 | if (!wlc_init(&interface, argc, argv)) { |
43 | return 1; | 42 | return 1; |
44 | } | 43 | } |
45 | |||
46 | setenv("DISPLAY", ":1", 1); | 44 | setenv("DISPLAY", ":1", 1); |
45 | |||
47 | if (!load_config()) { | 46 | if (!load_config()) { |
48 | sway_abort("Unable to load config"); | 47 | sway_abort("Unable to load config"); |
49 | } | 48 | } |