summaryrefslogtreecommitdiffstats
path: root/sway/commands
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/include.c6
-rw-r--r--sway/commands/reload.c6
-rw-r--r--sway/commands/swaynag_command.c20
3 files changed, 28 insertions, 4 deletions
diff --git a/sway/commands/include.c b/sway/commands/include.c
index 1ba9a10d..61f383bb 100644
--- a/sway/commands/include.c
+++ b/sway/commands/include.c
@@ -7,8 +7,10 @@ struct cmd_results *cmd_include(int argc, char **argv) {
7 return error; 7 return error;
8 } 8 }
9 9
10 if (!load_include_configs(argv[0], config)) { 10 if (!load_include_configs(argv[0], config,
11 return cmd_results_new(CMD_INVALID, "include", "Failed to include sub configuration file: %s", argv[0]); 11 &config->swaynag_config_errors)) {
12 return cmd_results_new(CMD_INVALID, "include",
13 "Failed to include sub configuration file: %s", argv[0]);
12 } 14 }
13 15
14 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 16 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
diff --git a/sway/commands/reload.c b/sway/commands/reload.c
index 5c1b19b4..f8ca374d 100644
--- a/sway/commands/reload.c
+++ b/sway/commands/reload.c
@@ -19,8 +19,9 @@ struct cmd_results *cmd_reload(int argc, char **argv) {
19 list_add(bar_ids, strdup(bar->id)); 19 list_add(bar_ids, strdup(bar->id));
20 } 20 }
21 21
22 if (!load_main_config(config->current_config_path, true)) { 22 if (!load_main_config(config->current_config_path, true, false)) {
23 return cmd_results_new(CMD_FAILURE, "reload", "Error(s) reloading config."); 23 return cmd_results_new(CMD_FAILURE, "reload",
24 "Error(s) reloading config.");
24 } 25 }
25 ipc_event_workspace(NULL, NULL, "reload"); 26 ipc_event_workspace(NULL, NULL, "reload");
26 27
@@ -42,5 +43,6 @@ struct cmd_results *cmd_reload(int argc, char **argv) {
42 list_free(bar_ids); 43 list_free(bar_ids);
43 44
44 arrange_windows(&root_container); 45 arrange_windows(&root_container);
46
45 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 47 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
46} 48}
diff --git a/sway/commands/swaynag_command.c b/sway/commands/swaynag_command.c
new file mode 100644
index 00000000..c57a80a6
--- /dev/null
+++ b/sway/commands/swaynag_command.c
@@ -0,0 +1,20 @@
1#include <string.h>
2#include "sway/commands.h"
3#include "log.h"
4#include "stringop.h"
5
6struct cmd_results *cmd_swaynag_command(int argc, char **argv) {
7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "swaynag_command", EXPECTED_AT_LEAST, 1))) {
9 return error;
10 }
11
12 if (config->swaynag_command) {
13 free(config->swaynag_command);
14 }
15 config->swaynag_command = join_args(argv, argc);
16 wlr_log(WLR_DEBUG, "Using custom swaynag command: %s",
17 config->swaynag_command);
18
19 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
20}