aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 26fa771e..e251f167 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -55,6 +55,7 @@ static sway_cmd cmd_font;
55static sway_cmd cmd_for_window; 55static sway_cmd cmd_for_window;
56static sway_cmd cmd_fullscreen; 56static sway_cmd cmd_fullscreen;
57static sway_cmd cmd_gaps; 57static sway_cmd cmd_gaps;
58static sway_cmd cmd_include;
58static sway_cmd cmd_input; 59static sway_cmd cmd_input;
59static sway_cmd cmd_kill; 60static sway_cmd cmd_kill;
60static sway_cmd cmd_layout; 61static sway_cmd cmd_layout;
@@ -1141,6 +1142,19 @@ static struct cmd_results *input_cmd_tap(int argc, char **argv) {
1141 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 1142 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
1142} 1143}
1143 1144
1145static struct cmd_results *cmd_include(int argc, char **argv) {
1146 struct cmd_results *error = NULL;
1147 if ((error = checkarg(argc, "include", EXPECTED_EQUAL_TO, 1))) {
1148 return error;
1149 }
1150
1151 if (!load_include_configs(argv[0], config)) {
1152 return cmd_results_new(CMD_INVALID, "include", "Failed to include sub configuration file: %s", argv[0]);
1153 }
1154
1155 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
1156}
1157
1144static struct cmd_results *cmd_input(int argc, char **argv) { 1158static struct cmd_results *cmd_input(int argc, char **argv) {
1145 struct cmd_results *error = NULL; 1159 struct cmd_results *error = NULL;
1146 if ((error = checkarg(argc, "input", EXPECTED_AT_LEAST, 2))) { 1160 if ((error = checkarg(argc, "input", EXPECTED_AT_LEAST, 2))) {
@@ -1541,7 +1555,9 @@ static struct cmd_results *cmd_reload(int argc, char **argv) {
1541 if ((error = checkarg(argc, "reload", EXPECTED_EQUAL_TO, 0))) { 1555 if ((error = checkarg(argc, "reload", EXPECTED_EQUAL_TO, 0))) {
1542 return error; 1556 return error;
1543 } 1557 }
1544 if (!load_config(NULL)) return cmd_results_new(CMD_FAILURE, "reload", "Error(s) reloading config."); 1558 if (!load_main_config(config->current_config, true)) {
1559 return cmd_results_new(CMD_FAILURE, "reload", "Error(s) reloading config.");
1560 }
1545 1561
1546 load_swaybars(); 1562 load_swaybars();
1547 1563
@@ -2053,6 +2069,7 @@ static struct cmd_handler handlers[] = {
2053 { "for_window", cmd_for_window }, 2069 { "for_window", cmd_for_window },
2054 { "fullscreen", cmd_fullscreen }, 2070 { "fullscreen", cmd_fullscreen },
2055 { "gaps", cmd_gaps }, 2071 { "gaps", cmd_gaps },
2072 { "include", cmd_include },
2056 { "input", cmd_input }, 2073 { "input", cmd_input },
2057 { "kill", cmd_kill }, 2074 { "kill", cmd_kill },
2058 { "layout", cmd_layout }, 2075 { "layout", cmd_layout },