aboutsummaryrefslogtreecommitdiff
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) {
return error;
}
- if (!load_include_configs(argv[0], config)) {
- return cmd_results_new(CMD_INVALID, "include", "Failed to include sub configuration file: %s", argv[0]);
+ if (!load_include_configs(argv[0], config,
+ &config->swaynag_config_errors)) {
+ return cmd_results_new(CMD_INVALID, "include",
+ "Failed to include sub configuration file: %s", argv[0]);
}
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) {
list_add(bar_ids, strdup(bar->id));
}
- if (!load_main_config(config->current_config_path, true)) {
- return cmd_results_new(CMD_FAILURE, "reload", "Error(s) reloading config.");
+ if (!load_main_config(config->current_config_path, true, false)) {
+ return cmd_results_new(CMD_FAILURE, "reload",
+ "Error(s) reloading config.");
}
ipc_event_workspace(NULL, NULL, "reload");
@@ -42,5 +43,6 @@ struct cmd_results *cmd_reload(int argc, char **argv) {
list_free(bar_ids);
arrange_windows(&root_container);
+
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
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 @@
+#include <string.h>
+#include "sway/commands.h"
+#include "log.h"
+#include "stringop.h"
+
+struct cmd_results *cmd_swaynag_command(int argc, char **argv) {
+ struct cmd_results *error = NULL;
+ if ((error = checkarg(argc, "swaynag_command", EXPECTED_AT_LEAST, 1))) {
+ return error;
+ }
+
+ if (config->swaynag_command) {
+ free(config->swaynag_command);
+ }
+ config->swaynag_command = join_args(argv, argc);
+ wlr_log(WLR_DEBUG, "Using custom swaynag command: %s",
+ config->swaynag_command);
+
+ return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+}