diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-30 00:11:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-30 00:11:00 -0400 |
commit | 9d7f47746cdcb0eed3cf41875d06a8ef238eef1c (patch) | |
tree | 997658454de40db3f8b76b68d658efaf2b686188 /sway/commands/bar/swaybar_command.c | |
parent | 7162b9bea4d66d61376ad3605e23e2d83bb95201 (diff) | |
parent | f26ecd9f58bb672fe107660ce9b37f4bf0777a8c (diff) |
Merge pull request #1648 from swaywm/swaybar-layers
Port swaybar to layer shell
Diffstat (limited to 'sway/commands/bar/swaybar_command.c')
-rw-r--r-- | sway/commands/bar/swaybar_command.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sway/commands/bar/swaybar_command.c b/sway/commands/bar/swaybar_command.c new file mode 100644 index 00000000..520cdd11 --- /dev/null +++ b/sway/commands/bar/swaybar_command.c @@ -0,0 +1,20 @@ +#include <string.h> +#include "sway/commands.h" +#include "log.h" +#include "stringop.h" + +struct cmd_results *bar_cmd_swaybar_command(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "swaybar_command", EXPECTED_AT_LEAST, 1))) { + return error; + } + if (!config->current_bar) { + return cmd_results_new(CMD_FAILURE, + "swaybar_command", "No bar defined."); + } + free(config->current_bar->swaybar_command); + config->current_bar->swaybar_command = join_args(argv, argc); + wlr_log(L_DEBUG, "Using custom swaybar command: %s", + config->current_bar->swaybar_command); + return cmd_results_new(CMD_SUCCESS, NULL, NULL); +} |