diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c index 26fa771e..bc8c42eb 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -55,6 +55,7 @@ static sway_cmd cmd_font; | |||
55 | static sway_cmd cmd_for_window; | 55 | static sway_cmd cmd_for_window; |
56 | static sway_cmd cmd_fullscreen; | 56 | static sway_cmd cmd_fullscreen; |
57 | static sway_cmd cmd_gaps; | 57 | static sway_cmd cmd_gaps; |
58 | static sway_cmd cmd_include; | ||
58 | static sway_cmd cmd_input; | 59 | static sway_cmd cmd_input; |
59 | static sway_cmd cmd_kill; | 60 | static sway_cmd cmd_kill; |
60 | static sway_cmd cmd_layout; | 61 | static 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 | ||
1145 | static 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 | |||
1144 | static struct cmd_results *cmd_input(int argc, char **argv) { | 1158 | static 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,7 @@ 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(NULL, true)) return cmd_results_new(CMD_FAILURE, "reload", "Error(s) reloading config."); |
1545 | 1559 | ||
1546 | load_swaybars(); | 1560 | load_swaybars(); |
1547 | 1561 | ||
@@ -2053,6 +2067,7 @@ static struct cmd_handler handlers[] = { | |||
2053 | { "for_window", cmd_for_window }, | 2067 | { "for_window", cmd_for_window }, |
2054 | { "fullscreen", cmd_fullscreen }, | 2068 | { "fullscreen", cmd_fullscreen }, |
2055 | { "gaps", cmd_gaps }, | 2069 | { "gaps", cmd_gaps }, |
2070 | { "include", cmd_include }, | ||
2056 | { "input", cmd_input }, | 2071 | { "input", cmd_input }, |
2057 | { "kill", cmd_kill }, | 2072 | { "kill", cmd_kill }, |
2058 | { "layout", cmd_layout }, | 2073 | { "layout", cmd_layout }, |