diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | sway/commands.c | 7 | ||||
-rw-r--r-- | sway/config.c | 4 | ||||
-rw-r--r-- | sway/handlers.c | 1 | ||||
-rw-r--r-- | sway/main.c | 3 |
5 files changed, 12 insertions, 5 deletions
@@ -9,6 +9,8 @@ It's a work in progress, proceed at your own risk. ![](https://sr.ht/qxGE.png) +Chat on #sway on irc.freenode.net + ## Rationale I use i3 on xorg. Wayland is coming, and [i3way](http://i3way.org/) still has 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]); 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 @@ #include "commands.h" #include "config.h" +struct sway_config *config; + bool load_config() { sway_log(L_INFO, "Loading config"); // TODO: Allow use of more config file locations @@ -82,7 +84,7 @@ _continue: } if (is_active) { - config->reloading = true; + config->reloading = false; } return config; diff --git a/sway/handlers.c b/sway/handlers.c index 979eb3c8..78ca1363 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -77,7 +77,6 @@ bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifiers } else if (state == WLC_KEY_STATE_RELEASED && mid < head) { memmove(array + mid, array + mid + 1, sizeof*array * (--head - mid)); } - sway_log(L_INFO,"%d", head); // TODO: reminder to check conflicts with mod+q+a versus mod+q int i; for (i = 0; i < mode->bindings->length; ++i) { 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 @@ #include "log.h" #include "handlers.h" -struct sway_config *config; int main(int argc, char **argv) { init_log(L_DEBUG); // TODO: Control this with command line arg @@ -42,8 +41,8 @@ int main(int argc, char **argv) { if (!wlc_init(&interface, argc, argv)) { return 1; } - setenv("DISPLAY", ":1", 1); + if (!load_config()) { sway_abort("Unable to load config"); } |