summaryrefslogtreecommitdiffstats
path: root/sway/commands/bar/status_command.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/bar/status_command.c')
-rw-r--r--sway/commands/bar/status_command.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sway/commands/bar/status_command.c b/sway/commands/bar/status_command.c
new file mode 100644
index 00000000..5e199cde
--- /dev/null
+++ b/sway/commands/bar/status_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 *bar_cmd_status_command(int argc, char **argv) {
7 struct cmd_results *error = NULL;
8 if ((error = checkarg(argc, "status_command", EXPECTED_AT_LEAST, 1))) {
9 return error;
10 }
11 if (!config->current_bar) {
12 return cmd_results_new(CMD_FAILURE,
13 "status_command", "No bar defined.");
14 }
15 free(config->current_bar->status_command);
16 config->current_bar->status_command = join_args(argv, argc);
17 wlr_log(L_DEBUG, "Feeding bar with status command: %s",
18 config->current_bar->status_command);
19 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
20}